Reset Field with Action Code Snippet

Questions about and code samples for automation process code snippets within Select.
Post Reply
smstreet83
Posts: 4
Joined: Thu May 04, 2017 1:15 pm

Reset Field with Action Code Snippet

Post by smstreet83 » Tue Apr 06, 2021 12:57 pm

How would you reset a field with an action code snippet?
I'm able to set the values using automation and the code snippet below, but it would be much better if I could clear the field and let the default split values flow through. Please let me know if you need more info. Thank you!

Code: Select all

tic = Context.Title.TitleInsuranceCalculations[0]
tic.LoanPolicy.SplitCalculation.Split1.Percent = Decimal(.20)
tic.OwnersPolicy.SplitCalculation.Split1.Percent = Decimal(.20)

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

Re: Reset Field with Action Code Snippet

Post by BobRichards » Wed Apr 07, 2021 10:45 am

In the same way you can get the value of a property using IOrderItem methods, you can call the Reset() method for the property to return it to it's default state. Make sure you add the IOrderItem namespace import so it is defined.

Code: Select all

...
from SoftPro.OrderTracking.Client.Orders import *

tic = Context.Title.TitleInsuranceCalculations[0]
IOrderItem.Reset(tic.LoanPolicy.SplitCalculation.Split1, 'Percent')
Bob Richards, Software Developer, SoftPro

smstreet83
Posts: 4
Joined: Thu May 04, 2017 1:15 pm

Re: Reset Field with Action Code Snippet

Post by smstreet83 » Wed Apr 07, 2021 11:57 am

That worked perfectly, thank you so much!

Post Reply