• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

How to retrieve the calling grid widget id in a Initial Value Program

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to retrieve the calling grid widget id in a Initial Value Program

    Hi,

    I am having several apps with a grid widget that uses a similar filter (Select customer).
    The filter uses a Initial Value Program. This program is the same for all widgets/apps that uses this filter, only the field parameter in the SetValue function differs depending on the grid widget the Initial Value Program is called from.

    Like:
    SetValue('PMVA3':%char(CustomerNumber));
    The 'PMVA3' value is dependent on the widget.

    Now I can recreate a Initial Value Program for each filter but it would be cleaner if I could request the calling grid widget id in my program and adjust the SetValue accordingly.

    Is that possible?

    Regards,
    Theo



  • #2
    Hi,

    The call to Initial Value Program always gets passed "widgetId" so you could pull that in and based on the widget id perform your set values.

    Code:
    widgetId = vvIn_num('widgetId');

    Comment


    • #3
      Yes, Thanks that worked!

      Comment


      • #4
        Hi Johnny,
        I was wondering if I could have find that myself in the documentation or the RPG code?
        I would like to see what the options are for the vvIn_xxx procedures.
        Kind regards,
        Theo

        Comment


        • #5
          Hi Theo,

          If you are asking what is available "passed from the front-end" to your RPG program you can always see whats passed from the browser via developer tools.

          Below is a screenshot of Chrome developer tools on the call to my filter initial value program. You can see on this call widgetId is passed as one of the parameters. Then you would use vvIn_ to pull the value and those procedures are documented here.

          Screen Shot 2020-02-13 at 9.50.31 AM.png

          Thanks

          Comment

          Working...
          X