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(): 
     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() 
Maximo Scripting – Yes/No/Cancel dialog

4 thoughts on “Maximo Scripting – Yes/No/Cancel dialog

  1. I’m feeling a bit thick for asking this but where are we telling Maximo what message to display as a question in the dialog?

    1. Here: service.yncerror(“asset”, “assetpr”, params)
      Go to Database Administration > Messages and search for asset/assetpr message

  2. I have same kind of requirement, I added above code, I can able to populate dialog box , but after click on YES/NO it won’t proceeding, the error message prompted again and again on click of yes/no

Leave a Reply

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

Scroll to top