Maximo Scripting – Yes/No/Cancel dialog

This post is an excerpt from the Maximo 76 Scripting Features guide.

YNC (Yes, No, Cancel) interactions can now be implemented using automation scripts. We need to do some prep work before writing the script. First we need to define a message that support the YNC interaction. Make sure you have the message as informational (I) and support the Yes and No buttons.

The use case below launches a yes/no dialog when the priority is set to 1. It asks the user if the he/she wants to set a default vendor for this. If the user select “yes” the script will set the default vendor A0001 and will mark the vendor field as required. If the user selects “no” vendor is marked as not required.

The script shown below associates the var v with vendor and is added as an Attribute Launch point script with “action” event. “assetpr” has been defined in the “asset” group as an informational message with buttons Y and N enabled.

def yes(): 
     global v,v_required 
     v = "A0001" 
     v_required = True 
 def no(): 
     global v,v_required 
     v_required = False; 
 def dflt(): 
     service.log("dflt") 
     params = [str(priority)] 
     service.yncerror("asset", "assetpr", params) 
 cases = {service.YNC_NULL:dflt, service.YNC_YES:yes, service.YNC_NO:no} 
 if interactive: 
    if priority==1: 
       x = service.yncuserinput() 
       cases[x]()
Maximo Scripting – Yes/No/Cancel dialog
Share this post...

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top