Set Invoice Date
Posted: Thu Jun 21, 2018 11:05 am
Can't get this to work if the field it's looking to is blank. Should just run default rule but it's returning an 'Expected Int64, got NoneType' Error.
def Invoice_Date_Value(args):
invoice = args.Context
order = args.Context.Root
if not invoice:
return
# Get the value for the Custom Fields
AddRevDate = Date(IOrderItem.GetProperty(invoice, 'AddlRevDate_#'))
if IOrderItem.GetProperty(invoice, 'AddlRevDate_#') is not None:
args.Value = AddRevDate
else:
args.RunDefaultRule()
def Invoice_Date_Value(args):
invoice = args.Context
order = args.Context.Root
if not invoice:
return
# Get the value for the Custom Fields
AddRevDate = Date(IOrderItem.GetProperty(invoice, 'AddlRevDate_#'))
if IOrderItem.GetProperty(invoice, 'AddlRevDate_#') is not None:
args.Value = AddRevDate
else:
args.RunDefaultRule()