Forum Stats

  • 3,838,654 Users
  • 2,262,389 Discussions
  • 7,900,724 Comments

Discussions

How can I default a page item to the value of a column in the first row of an interactive report?

user1.0
user1.0 Member Posts: 98 Red Ribbon

Apex V 19.2

I have 2 interactive reports 1 is the master, the other is the detail.

I have it setup so the detail is populated when a link column is clicked in the master.

I did this by following these instructions (Thanks Scott!):

Scott Wesley Member Posts: 6,171 Gold Crown

Aug 8, 2018 1:03AM edited Aug 8, 2018 1:03AM

A number of ways, here is one

  1. Create hidden item: P1_DEPTNO
  2. In your Dept region, make Deptno a Link column
    1. Set the link target as url: javascript:$s('P1_DEPTNO, #DEPTNO#);
    2. Set the link text as: #DEPTNO#
  3. Create on change dynamic action on P1_DEPTNO
    1. Add action to refresh Emp report
  4. In your Emp region, set Page Items To Submit: P1_DEPTNO

I'd like to automatically populate the detail report using the link column from the first row when the user clicks a Search button to populate the master report.

Also, I'm giving users the option to use the built in sort options from the action menu, so ideally the detail grid would refresh to show the detail related to the 1st row whenever the user resorted the master.

How would I get the value of the link column in my first row?

I'm assuming once I have the value of the link set in my page item I can refresh the detail report after the master report is refreshed.

Tagged:
zvi weinstock

Best Answer

  • InoL
    InoL Member Posts: 9,987 Gold Crown
    Answer ✓

    I know a lot was added in versions 20 & 21 but we're stuck on 19

    I don't think so.

    IRs do not have master-detail functionality out of the box. However, using read-only IGs for this sounds like an alternative. There are plenty of issues with IGs, but not when they are used as read only reports.

    But then again, it depends what you need. There are differences between IR and IG, and the ideas app (apex.com/ideas) is full of "please make IR and IG behave the same way"

    You can google for IR solutions that you probably have to tweak. First one that came up:


Answers

  • InoL
    InoL Member Posts: 9,987 Gold Crown

    Sounds like doing it the hard way. Creating master-detail IGs is pretty easy: use the create page wizard, and select the Stacked master-detail.

  • user1.0
    user1.0 Member Posts: 98 Red Ribbon

    InoL,

    I'm creating a wizard app. So, I can either save time using the page wizard to get the steps setup easily and in order or I can do it your way and use the page wizard to create each page in my wizard using the page wizard and then create the steps section on each page and link them manually.

    At any rate. I tried to use the page wizard to create a master-detail/stacked page as you suggested and ran into a problem trying to select the master source. My view is not in the list for table/views. Only my tables are available.

    If I try to add the view to a region manually the view is available, so it seems to be accessible to the app.

    Since the master/detail wizard doesn't seem to work with views, I still need to know how to link 2 IR or IG manually.

    My first page is a view only which is why I went with IR. The next step is an IG where the user can modify the records. There's some setup data creation going on after they view the selected records so the IG records are prepped. I thought about combining these steps, but this is a sensitive area of the project so I want to be extra careful.

    Plus I may need to create entitlements for different users to view only and skip out of the wizard before the IG page in the future.

  • InoL
    InoL Member Posts: 9,987 Gold Crown

    My view is not in the list for table/views. Only my tables are available.

    That is odd. Are your views in the same schema? Views do come up in the list, but only the views in the current application schema.

    Linking IGs is done via the Master Region property in the detail IG.

    Then, link the detail FK column to the master PK column via the FK column property "Master Column".

    On a side note: it seems odd that you have a complex master-detail IG in a wizard. A wizard is usually simple and form based. You may have to reconsider your design.

  • user1.0
    user1.0 Member Posts: 98 Red Ribbon
    edited Apr 6, 2022 3:55PM

    Yes, my views are in the same schema as the tables that show up.

    I realize using a grid (IR or IG) in a wizard seems odd, but I've got a set of records that need to stay organized the same way. Plus, There are several similar updates that need to be made that are related to each other. It's hard to explain.

    Imagine you were creating a spreadsheet (yes I know...Apex isn't a spreadsheet. I know this but I'm told to use Apex anyway.) You have a chart of accounts with 5 accounts where each account has a share % of the whole amount. The user needs to see all 5 accounts at the same time so they can see that the % overall is 100%. Plus, several other values for each account are the same so I don't want to force the user through a single step to complete the chart for each account.

    I found using the page wizard to create the steps was faster than trying to do this in the pages separately. I'm being a bit of a control freak with this application forcing users to do things in order because I tried it as a free flowing application and ran into a lot of user related data errors. The validation seems to be much easier to manage using the wizard layout.

    Nothing we do is "normal" for Apex. But someone said it "could" be done so here we are with a square peg and a round hole (again). I'm doing my best to use the built in functionality even if it may not be typical/traditional usage.

    I saw the Master property in the IG but not in the IR. So I'm trying to control it manually. I guess I could change the IR's to IG's that aren't editable. I haven't had a lot of success with the IG though. I always seem to need something that isn't available yet. I know a lot was added in versions 20 & 21 but we're stuck on 19 until IE is officially dead.

  • InoL
    InoL Member Posts: 9,987 Gold Crown
    Answer ✓

    I know a lot was added in versions 20 & 21 but we're stuck on 19

    I don't think so.

    IRs do not have master-detail functionality out of the box. However, using read-only IGs for this sounds like an alternative. There are plenty of issues with IGs, but not when they are used as read only reports.

    But then again, it depends what you need. There are differences between IR and IG, and the ideas app (apex.com/ideas) is full of "please make IR and IG behave the same way"

    You can google for IR solutions that you probably have to tweak. First one that came up: