Automation and Checkbox

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

Automation and Checkbox

Post 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.
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Automation and Checkbox

Post by BobRichards »

Please provide your code so I can advise.
Bob Richards, Senior Software Developer, SoftPro
kendale.wyatt
Posts: 27
Joined: Wed Sep 26, 2018 1:24 pm

Re: Automation and Checkbox

Post 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
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Automation and Checkbox

Post 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.
Bob Richards, Senior Software Developer, SoftPro
kendale.wyatt
Posts: 27
Joined: Wed Sep 26, 2018 1:24 pm

Re: Automation and Checkbox

Post 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
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Automation and Checkbox

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