Comparing Current and Updated Values

Hello newbie here I have a task that I need to compare the current values to  updated values  . Once the Coporate Name and Merchant Name have a difference it will pop up a confirmation messager after clicking submit.

I hoped you can help me. Thank you ♥

  Discussion posts and replies are publicly visible

  • Hi John, 

    For this, you simply use the equals(=) operator to compare the variables that you are using to store the value of merchant name and corporate name in the button confirmation header and message. 

    Talking more about it, the buttonWidget has two properties, which are - confirmationHeader and confirmationMessage. You can simply use an if condition in those properties to compare the values of the variables, if they are not equal, then add a string header and message, else, leave it blank. 

  • 0
    Certified Lead Developer

    For this simple case, create two local variables to store the rule input values. Make sure to use a!refreshvariables to disable refresh.

    a!localVariables(
      local!oldValue: a!refreshVariable(
        value: ri!purchaseRequest.specialInstructions,
        refreshOnReferencedVarChange: false
      ),
    .
    .
    .
    

    Then compare old and new value.