If you're really sure you want to throw the same error for both conditions, simplify it with:
from psdi.mbo import MboConstants
from psdi.server import MXServer
# Declare a variable for the value of the GLACCOUNT attribute
glAccount = mbo.getString('glaccount')
if glAccount is None or glAccount.endswith('-??????'):
errorgroup = 'WORKORDER'
errorkey = 'GLAcctIncomplete'
Otherwise:
from psdi.mbo import MboConstants
from psdi.server import MXServer
# Declare a variable for the value of the GLACCOUNT attribute
glAccount = mbo.getString('glaccount')
if glAccount is None:
errorgroup = 'WORKORDER'
# make a different error message for this
errorkey = 'GLAcctIsNull'
elif glAccount.endswith('-??????'):
errorgroup = 'WORKORDER'
errorkey = 'GLAcctIncomplete'
------------------------------
Travis Herron
Pensacola Christian College
------------------------------
Original Message:
Sent: 11-19-2021 04:13
From: Peter McDonald
Subject: Automation Scripts
Hi Folks
I'm more familiar with SQL than I am python, would appreciate it if someone could help me out with the correct syntax for the bolded section for my automation script, thanks in advance
Cheers
from psdi.mbo import MboConstants
from psdi.server import MXServer
if mbo.isNull("GLACCOUNT"):
errorgroup ="WORKORDER"
errorkey = "GLAcctIncomplete"
else:
mbo.getString("GLACCOUNT") like "%-??????"
errorgroup ="WORKORDER"
errorkey = "GLAcctIncomplete"
#Customizations
#EverythingMaximo
------------------------------
Peter McDonald
Prima58
------------------------------