Default Policy Lookup Code

Questions about and code samples for custom order rules and validation within Select.
Post Reply
B_Hinote
Posts: 57
Joined: Tue Jan 08, 2019 7:20 pm

Default Policy Lookup Code

Post by B_Hinote »

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?

Code: Select all

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

Re: Default Policy Lookup Code

Post by BobRichards »

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?
Bob Richards, Senior Software Developer, SoftPro
B_Hinote
Posts: 57
Joined: Tue Jan 08, 2019 7:20 pm

Re: Default Policy Lookup Code

Post by B_Hinote »

Yes, that is the Policy Code. (See Attached)

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?

Thank you
Attachments
Policy Codes.jpg
Policy Codes.jpg (88.69 KiB) Viewed 3155 times
Post Reply