• 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.

Passing data to the Form before form is displayed

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

  • Passing data to the Form before form is displayed

    I have a widget that show all the rows of the table
    When i click on any record on the widget it will take you to the next screen where there is a form (say myform ). And display more information of the selected record. Also has two nav buttons one for printing and other for deleting and one more button called 'previous' to return back to the main widget to select next record. ( all the buttons are functioning properly there are seperate RPG behind them)

    Now on the form i have a field that has to be populated based on the computed value from the program say field XYZ .

    So i have included a call to the RPG program from the widget when the row is clicked .

    Currently the SQL used in the form (myform ) is showing the value of the field XYZ
    from the table field asis .
    In the RPG program i have set up procedure to compute the XYZ field

    How can i return the computed value to the myform and override the sql table value for XYZ before the displaying the myform , so that when XYZ is displayed it should display computed value instead of table field value ?

    I tried to use the below code in the RPG program.
    SetWidget('myForm');
    SetResponse('formFieldValue':'XYZ':'NET30');
    before the form is dispalyed once the row click is done. But is not displaying the NET30 instead its showing the value from the table used inside the myForm .

    Appreciate the help
    Thanks

  • #2
    I would suggest linking an app variable to the form field to set its value, and then your RPG program can set the value of that app variable

    Screenshot 2023-09-15 at 12.23.57 PM.png

    Comment


    • #3
      Thanks it worked as expected!!!

      Comment

      Working...
      X