How to save the error message from a field validation

Is there a way for me to save the error message from a field validation so that I can show it at a later stage on a different form and user task?

OriginalPostID-223308

OriginalPostID-223308

  Discussion posts and replies are publicly visible

Parents
  • If I'm understand the question correctly you'll need to do a few things. On the form when the validation is first determined you'll need to use validation groups. Set the validation groups for the fields that you wish to validate later to the same string. This will allow the user to see the validation, but the submit button will ignore it unless its validation group is also set to that string. You should save the validation message into a Process Variable so it can be passed to the next form. On the next User Task, pull in the Process Variable that contains the validation message so that it can be accessed by the forms rule inputs. On the desired field or form set the validation to:

    if(
    isnull( ri!validationMessage_text ),
    {},
    ri!validationMessage_text
    )

    Any time that the validation message was generated on the previous User Task, it will prevent submission on the new User Task. Be aware though that unless the validation can be changed on this new UI the user won't be able to leave. You many need to use two different validation groups on two different buttons on this second User Task so that a Cancel or Back button will allow the user to terminate or correct the process, but a Next button will not be able to submit the form. The skipValidation field on buttons can be useful for a catch all "Shut this process down" cancel button.

    If the User Tasks are in different processes your best bet might be queryProcessAnalytics() and a portal report to track specific fields in the other process.
Reply
  • If I'm understand the question correctly you'll need to do a few things. On the form when the validation is first determined you'll need to use validation groups. Set the validation groups for the fields that you wish to validate later to the same string. This will allow the user to see the validation, but the submit button will ignore it unless its validation group is also set to that string. You should save the validation message into a Process Variable so it can be passed to the next form. On the next User Task, pull in the Process Variable that contains the validation message so that it can be accessed by the forms rule inputs. On the desired field or form set the validation to:

    if(
    isnull( ri!validationMessage_text ),
    {},
    ri!validationMessage_text
    )

    Any time that the validation message was generated on the previous User Task, it will prevent submission on the new User Task. Be aware though that unless the validation can be changed on this new UI the user won't be able to leave. You many need to use two different validation groups on two different buttons on this second User Task so that a Cancel or Back button will allow the user to terminate or correct the process, but a Next button will not be able to submit the form. The skipValidation field on buttons can be useful for a catch all "Shut this process down" cancel button.

    If the User Tasks are in different processes your best bet might be queryProcessAnalytics() and a portal report to track specific fields in the other process.
Children
No Data