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

Edit Grid Validation

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

  • Edit Grid Validation

    Doing a simple edit grid of a single table that contains multiple fields with user ID's. On
    Add and Edit, I am validating the user ID against qsys2.user_info.
    However, I'd like to highlight the field that's in error instead of just issuing an error with SetError() and a message.

    Is that possible w/out much work?

    I'm trying to use
    SetResponse('success':'false');
    SetResponse('formFieldError':'CREDIT_MGR':'Invalid IBM i User ID ' + userID);

    The error box comes up empty with an "OK" button.

    It works if I use SendError() with a customized message - just thought it would be nice to go "indicate" the form field for the user.
    Last edited by gwilburn; 01-13-2022, 01:28 PM. Reason: SendError not SetError

  • #2
    This does not look to be possible with EXNABVAL based programs. We will add this to our list though.

    Currently, SendError is your only option. As you know, this simply pops up a message over your form.

    Comment


    • #3
      Thanks for the quick response. SendError() works.
      Last edited by gwilburn; 01-13-2022, 01:28 PM. Reason: SendError not SetError

      Comment


      • #4
        Just want to confirm that you mean SendError and not SetError. SetError is available on the form helper (EXNABFHLP) based programs. This should allow you to set a message directly against a field.

        Comment


        • #5
          FYI - the next update will allow you to specify a field to attach your error to:

          Code:
          SendError('My error message':'MY_FIELD');

          Comment


          • #6
            SendError() is what I'm using. I'll edit my post so it doesn't confuse someone else.

            thanks!

            Comment

            Working...
            X