Automation and Checkbox

Questions about and code samples for automation process code snippets within Select.
Post Reply
kendale.wyatt
Posts: 19
Joined: Wed Sep 26, 2018 1:24 pm

Automation and Checkbox

Post by kendale.wyatt » Fri May 03, 2019 5:41 pm

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.

BobRichards
Posts: 1116
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Automation and Checkbox

Post by BobRichards » Sat May 04, 2019 5:27 pm

Please provide your code so I can advise.
Bob Richards, Senior Software Developer, SoftPro

kendale.wyatt
Posts: 19
Joined: Wed Sep 26, 2018 1:24 pm

Re: Automation and Checkbox

Post by kendale.wyatt » Mon May 06, 2019 10:44 am

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

BobRichards
Posts: 1116
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Automation and Checkbox

Post by BobRichards » Mon May 06, 2019 10:55 am

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.
Bob Richards, Senior Software Developer, SoftPro

kendale.wyatt
Posts: 19
Joined: Wed Sep 26, 2018 1:24 pm

Re: Automation and Checkbox

Post by kendale.wyatt » Mon May 06, 2019 11:43 am

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

BobRichards
Posts: 1116
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Automation and Checkbox

Post by BobRichards » Tue May 07, 2019 9:28 am

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.
Bob Richards, Senior Software Developer, SoftPro

Post Reply