Method Community

 

Populate Section Using First Grid Item RecordID on Screen Load

Last post 01-20-2012 3:01 PM by viret56. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 01-20-2012 7:54 AM

    • viret56
    • Top 75 Contributor
    • Joined on 01-10-2012
    • Virginia
    • Posts 79

    Populate Section Using First Grid Item RecordID on Screen Load

    I have a grid (customer list) and a section with fields (customer information) on the screen.  When the screen loads, I want to populate the section fields with data from the first customer in the grid list.  I thought using the action "Set Active Record ID for Screen" would do the trick, but I am not sure how to implement it.  How do I retrieve the RecordID for the first grid item and pass it to the above action?

    If I need to take a different approach, tell me about it.

  • 01-20-2012 10:32 AM In reply to

    • viret56
    • Top 75 Contributor
    • Joined on 01-10-2012
    • Virginia
    • Posts 79

    Re: Populate Section Using First Grid Item RecordID on Screen Load

     I am able to populate the screen using a link in the grid.  I did want the first grid item to be on the screen when the screen loaded, but using the link is acceptable.

    Still, if anyone knows of a solution to my original question, I think that would improve the functionality of the screen.

  • 01-20-2012 11:51 AM In reply to

    Re: Populate Section Using First Grid Item RecordID on Screen Load

    Hi viret56,

    From my understanding, you want set the screen to show the first value that is on the grid and do so without having to click on the screen to populate the information on the screen. 

    If so, you need to do the following steps:

    1. Check the filter criteria on the screen and make sure that the sorting is done by RecordID and "Ascending (A to Z)"

    2. On screen load, select the action "Retrieve Value From Table". Follow the following steps:

    a. Table is "Customer" and from field is "RecordID"

    b. Value is: Type in

    c. Place value is: "Action Result" and name the action result

    3. On screen load, select another action called "Set Active Record ID for Screen"

    a. Value: "Action Result"

    b. Name of the action result from the first action.

    I just wanted to let you know that these sets of actions would normally be used when you click on the "Go to..." 

    and "Select" link on a grid which would either open up another page or bring up a pop-up screen. 

    I hope that help.

    Ronen

  • 01-20-2012 11:53 AM In reply to

    Re: Populate Section Using First Grid Item RecordID on Screen Load

    Viret -

    I haven't tried doing anything like this before, but if I were to take a stab at it I'd probably start by looking at the "Advanced" options for the screen in question (when you edit the screen, there is an "Advanced" button at the top of the field/object list).

    This section allows you to create an action list based around screen events, such as OnScreenLoad (or whatever its called). The point is you can set the screen to automatically do someone upon loading the screen, or refreshing the screen, etc.

    What I don't know how to do is select the first line in a grid via an action list. Maybe you can create an action list for the grid as well, setting the first line to the ActiveRecordID upon screen load, then having the screen action list populate the fields based off that ActiveRecordID upon screen load.

     

    I'd be interested in hearing a solution if you come up with one!

    -Sam

    Edit: LOL, by the time I posted this Ronen had written up a step by step guide. Good times.

  • 01-20-2012 12:30 PM In reply to

    Re: Populate Section Using First Grid Item RecordID on Screen Load

    Hi Viret,

    Just as a follow-up to what we have dscussed, I wanted to let you know that this is not how we normally set the actve ID on our original screens. The way we set an active ID is when we open up a tab link, a screen, a pop-up, and when you click on Select within a grid to populate the information onto the screen.  

    I hope that helps further. 

    Ronen

  • 01-20-2012 3:01 PM In reply to

    • viret56
    • Top 75 Contributor
    • Joined on 01-10-2012
    • Virginia
    • Posts 79

    Re: Populate Section Using First Grid Item RecordID on Screen Load

     Hi MethodPRonen,

    Thank you for your replies.  I have implemented your technique on page load.  It is close to what I want.  The grid is sorted on a field other than RecordID.  Unfortunately, the Retrieve Value From Table action provides no sorting parameters.  As you indicated in your instructions, I am retrieving records sorted by RecordID.  So the fields on the page populate with data from a record not in the visible grid list as the page loads.

    Adding the ability to select sorting in the Retrieve Value From Table would be a nice addition to the Method application.  I would also suggest that adding an action to retrieve data from a particular row in the visible grid would be useful.  At the least it would help me acheive my goal.

    Other than the page loading functionality I am trying to achieve, the page is functioning nicely.

    Thanks.

Page 1 of 1 (6 items)