Page 1 of 1

Automation and Checkbox

Posted: Fri May 03, 2019 5:41 pm
by kendale.wyatt
I am trying to set up automation for if the Settlement Date is greater than 04/30/2019 check the "Include in total" box on the Schedule D screen.
The field code browser shows this should be Order.Title.TitleProducts.ScheduleD.IncludeGuarantyFeeInTotal, however, I keep getting errors:

Error: 'Order' object has no attribute 'IncludeGuarantyFeeInTotal'
Error: 'Set[Commitment]' object has no attribute 'ScheduleD'
Error: 'Title' object has no attribute 'Commitment'

Any idea what I might be doing wrong? I have tried every variation I can think of and still end up with the same errors.

Re: Automation and Checkbox

Posted: Sat May 04, 2019 5:27 pm
by BobRichards
Please provide your code so I can advise.

Re: Automation and Checkbox

Posted: Mon May 06, 2019 10:44 am
by kendale.wyatt
def IncludeGuarantyFeeInTotal():
guaranty = False
for status in Context.IncludeGuarantyFeeInTotal:
if Context.Parent.Parent.SettlementDate != None and \
Context.Parent.Parent.SettlementDate >= “05/01/2019”:
guaranty = True
return

Re: Automation and Checkbox

Posted: Mon May 06, 2019 10:55 am
by BobRichards
One more thing - please provide the details of the action that you created ("When order first saved" or whatever) so I can make sure we agree on what the Context is. Sorry I didn't mention this requirement in the prior request.

Re: Automation and Checkbox

Posted: Mon May 06, 2019 11:43 am
by kendale.wyatt
First time an order is saved
and owning profile under 'Default\Automation Test'
and .SettlementDate is >= 05/01/2019
and order status in 'In Process'
Then do the following:
run code snippet

Re: Automation and Checkbox

Posted: Tue May 07, 2019 9:28 am
by BobRichards
Since the automation code runs "First time an order is saved", the Context is the Order. That explains the error "Error: 'Order' object has no attribute 'IncludeGuarantyFeeInTotal'" since when you examine the Field Code Browser (FCB), you see the Order doesn't have that property. Rewrite your code to use the context you are given.