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

Hiding Form Fields When Used with Edit Grid

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

  • Hiding Form Fields When Used with Edit Grid

    I'm trying to work out how to hide form fields that are hidden on the grid. I need the fields as I want to default values into them, but do not want these fields to be visible or available to the end user. Is this possible just through configuration of widgets or do I need to add a helper program to the form widget?

  • #2
    ?Sounds like the grid validation program will give you what you need.

    Below is my edit grid configuration. Suppose when adding a new product I want to auto generate it myself. So when adding I simply omit the field. Notice that I have specified a validation program named "MYVALPGM"...this is copied from EXNABVAL.

    ? image.png

    MYVALPGM has a "processAdd" procedure. Here I will add one line of code to set the value of PRDNO before the record is added to the database.

    Code:
    SetValue('MY_FILE':'PRDNO':'My new product number');
    Attached Files

    Comment


    • #3
      I think I may have worked it out. Instead of setting the field using a validation program, I used Link To App Variables > Set Field Value. Originally, I had the field I'm hiding on the form. I removed it and it seems to work as expected without RPG.

      image.png?

      Comment


      • #4
        I spoke too soon. Looks like that approach doesn't work consistently. Add is OK, but copy is a problem. I guess I will need to use an RPG program to set fields to defaults. It would be great if this could be done from NAB rather than having to develop custom RPG just to default values into fields.

        Comment


        • #5
          Can I still retrieve app variables within a grid validation program?

          Comment


          • #6
            Yes, use procedure "GetAppVar".

            Comment

            Working...
            X