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
------------------------------