Page 1 of 1

Reset Field with Action Code Snippet

Posted: Tue Apr 06, 2021 12:57 pm
by smstreet83
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)

Re: Reset Field with Action Code Snippet

Posted: Wed Apr 07, 2021 10:45 am
by BobRichards
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')

Re: Reset Field with Action Code Snippet

Posted: Wed Apr 07, 2021 11:57 am
by smstreet83
That worked perfectly, thank you so much!