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

Form Validation

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

  • Form Validation

    We have a form that is displayed upon clicking a grid row. Several form fields are "editable". I only want to validate the fields that are changed by the user. However, I can't seem to recall how to determine that.

    I'm currently validating in the RPG button program using vvNabBtn. In the vvNabTmpl tools there is a procedure isChanged(). But that is not available.

    What's the best approach here?

  • #2
    This is not available in your scenario. The "isChanged" procedure is used within the EXNABVAL (edit grid) based programs.

    In your case, I would suggest the following:
    Assuming you have a record behind the data in your form.

    Code:
    // retrieve the current values of the record...
    //
    lMyId = GetFormChar('MYID');
    exec sql select * into: lMyRecord from myFile where myId =: lMyId;
    
    if GetFormChar('SOMEFIELD') <> lMyRecord.SOMEFIELD;
      // validate...
    endif;

    Comment


    • #3
      Thanks Sean... so within NAB we don't know if a user modifies a specific form field?

      Comment


      • #4
        Only with the built in editing of the edit grid.

        Comment


        • #5
          Thanks! This worked like a charm

          Comment

          Working...
          X