Community

how to compare two fields and show error message use script

Hello every one:

when I create one document definition I want to compare two fields value use Script in rule tab,
And I want to implelement some function:


1.if one field value is empty ,no need to compare.

2.if both fields are not empty ,then if their not the same need show the error message to user in verfication station .

Was this article helpful?

0 out of 0 found this helpful

Comments

2 comments

  • Avatar
    Permanently deleted user
    There is probably a better and more efficient way of doing it but here is how I would do I would script it.


    if (not me.Field("Field1").Text = "" and not me.Field("Field2").Text = "") and (not me.Field("Field2").Text = me.Field("Field1").Text) Then





    Me.HasRuleError = true


    me.CheckSucceeded = false


    me.ErrorMessage = "put error message here"





    end if
    0
  • Avatar
    Permanently deleted user
    There is probably something more efficient but here is how I would approach it.:


    if (not me.Field("Field1").Text = "" and not me.Field("Field2").Text = "") and (not me.Field("Field2").Text = me.Field("Field1").Text) Then





    Me.HasRuleError = true


    me.CheckSucceeded = false


    me.ErrorMessage = "put error message here"





    end if
    0

Please sign in to leave a comment.