Saturday, 8 February 2020

Maximo Scripting – Yes/No/Cancel dialog

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]()

No comments:

Post a Comment

IBM Readme for IBM Maximo Asset Management 7.6.1.3 Fix Pack

  Fix Readme Abstract This fix pack updates IBM® Maximo® Asset Management version 7.6.1, 7.6.1.1, and 7.6.1.2 Content IBM Maximo Asset Manag...