YNC interactions by using scripting

You can design Yes, No, Cancel (YNC) interactions by using automation scripts. You must do some preparatory work before writing the script. First, define a message that supports the YNC interaction. Make sure that you have the message as informational and support the Yes and No buttons.

The following use case displays a yes or no dialog when the priority is set to 1. The dialog asks users if they want to set a default vendor. If the user selects “yes,” the script sets the default vendor A0001 and marks the vendor field as required. If the user selects “no,” vendor is marked as not required.

The following script associates the variable v with vendor and is added as an attribute launch point script with action event. The assetpr message key has been defined in the asset message group as an informational message with Y and N buttons enabled.
def yes():
  global v,v_required
  v = "A0001"
  v_required = True

def no():
  global v,v_required
  v_required = False;