I created the following basic code to try defaulting the Policy Lookup Code to a specific value, which it does. However, this apparently does not trigger the Change Event to cause the rest of the screen to be loaded.
Is there a way to force the application to react to this change within a COR or is this only possible through Custom Code/Integration?
def TitleInsuranceCalculation_PolicyLookupCode_Value(args):
# Exit if processing template.
if args.Context.Root.IsTemplate:
args.RunDefaultRule()
return
# Exit if not fully initialized
if (args.Context.Parent is None):
args.RunDefaultRule()
return
# Exit if Product Code is Not TSG
if (args.Context.Root.ProductType.Code.upper() != 'TSG'):
args.RunDefaultRule()
return
# Exit if Underwriter LookupDode in Not WC
if (hasattr(args.Context.Underwriter,'LookupCode')):
tiuCode = args.Context.Underwriter.LookupCode.upper()
else: tiuCode = 'NotSet'
if (tiuCode != 'WC'):
args.RunDefaultRule()
return
# Exit if not Owner Policy Type is Not Owners
if (hasattr(args.Context,'PolicyType')):
policyType = args.Context.PolicyType
else: policyType = None
if (policyType is None or policyType != PolicyType.Owners):
args.RunDefaultRule()
return
#Set the Policy LookupCode
args.Value = "WC-CA-Trustee's Sale Guarantee Policy" #Testing known value
Is "WC-CA-Trustee's Sale Guarantee Policy" a value in the "Lookup Code" column in the appropriate lookup table? It looks more like a value that would appear in the "Version" column.
What happens if you insert the same value in the lookup field manually in the Select app?
If I select the value from the dropdown, everything works as expected. I assume this is because selecting the item is firing a change event that is identifying that the value has been changed.
However, if I set this field using the COR the Policy Code Field display the correct value, but nothing else happens. (i.e. The Description does not load, No Rates are calculated, etc.) This is the same result I get if I set the field using a Formula.
Although the value set is correct, it appears that this Control is not recognizing that the field has been changed. In theory, I would have thought that changing the value from Null to a valid value would trigger the change event, but nothing is happening.
Is there some gimmick I can use to force this field to recognize it has been changed when the COR assigns the value?