Automation Script to throw warning message for issuing items against asset under warranty:
from java.util import Calendar
from psdi.server import MXServer
from psdi.util import MXApplicationException
if mbo.getOwner().getString('WARRANTYEXPDATE') =='':
errorgroup = ""
errorkey = ""
else:
if(mbo.getOwner().getDate('warrantyexpdate') >= (Calendar.getInstance().getTime())):
msgparams = [mbo.getOwner().getString('ASSETNUM')];
mxae = MXApplicationException("workorder","AssetWarrantyNotice",msgparams)
mbo.getThisMboSet().addWarning(mxae)
from java.util import Calendar
from psdi.server import MXServer
from psdi.util import MXApplicationException
if mbo.getOwner().getString('WARRANTYEXPDATE') =='':
errorgroup = ""
errorkey = ""
else:
if(mbo.getOwner().getDate('warrantyexpdate') >= (Calendar.getInstance().getTime())):
msgparams = [mbo.getOwner().getString('ASSETNUM')];
mxae = MXApplicationException("workorder","AssetWarrantyNotice",msgparams)
mbo.getThisMboSet().addWarning(mxae)
No comments:
Post a Comment