Splits Revisited - Endorsements
Posted: Wed Apr 11, 2018 2:52 pm
A while back , we put together a COR to set the some split values on the Title insurance premium screen. I want to do the same for the split fields on the endorsement screen. I am having a problem getting at those fields. Below is the code I have so far. This is working code which sets the split values on the TIP screen, I am adding the sections to set the endorsement split fields. When this is run, I get an error saying that "Error encountered during rule execution. 'type' object has no attribute 'OwnersPolicyEndorsement'"
When I comment out the OwnersPolicyEndorsement lines, I do not get the same error for LoanPolicyEndorsements (Which seems weird) but it does not work either (or generate and error for that matter).
When I comment out the OwnersPolicyEndorsement lines, I do not get the same error for LoanPolicyEndorsements (Which seems weird) but it does not work either (or generate and error for that matter).
Code: Select all
from System import *
from SoftPro.ClientModel import *
from SoftPro.OrderTracking.Client import *
from SoftPro.OrderTracking.Client.Orders import *
def Split_Dollars_Value(args):
split = args.Context
split1 = split.Parent.Split1
split2 = split.Parent.Split2
policy = split.Parent.Parent
Order = args.Context.Root
if (((str(policy).StartsWith('Loan')) or (str(policy).StartsWith('Own'))) and (Order.TitleCompanies)):
if split.Guid == split1.Guid:
if policy.Type == TitleProductType.LoanPolicy:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'Split1Loan_Dollars_901045##')
elif policy.Type == TitleProductType.OwnersPolicy:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'Split1Owners_Dollars_901045##')
# BELOW FOR ENDORSEMENTS
elif policy.Type == TitleProductType.OwnersPolicy.Endorsement:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'END_Split1Owners_Dollars_901045##')
elif policy.Type == TitleProductType.LoanPolicy.Endorsement:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'END_Split1Loan_Dollars_901045##')
if split.Guid == split2.Guid:
if policy.Type == TitleProductType.LoanPolicy:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'Split2Loan_Dollars_901045##')
elif policy.Type == TitleProductType.OwnersPolicy:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'Split2Owners_Dollars_901045##')
# BELOW FOR ENDORSEMENTS
elif policy.Type == TitleProductType.OwnersPolicy.Endorsement:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'END_Split2Owners_Dollars_901045##')
elif policy.Type == TitleProductType.LoanPolicy.Endorsement:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'END_Split2Loan_Dollars_901045##')
def DefaultSplit_Percent_Value(args):
defaultsplit = args.Context
defaultsplit1 = defaultsplit.Parent.Split1
defaultsplit2 = defaultsplit.Parent.Split2
policy = defaultsplit.Parent.Parent
Order = args.Context.Root
if (((str(policy).StartsWith('Loan')) or (str(policy).StartsWith('Own'))) and (Order.TitleCompanies)):
if defaultsplit.Guid == defaultsplit1.Guid:
if policy.Type == TitleProductType.LoanPolicy:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'Split1Loan_Percent_901045##')
elif policy.Type == TitleProductType.OwnersPolicy:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'Split1Owners_Percent_901045##')
# BELOW FOR ENDORSEMENTS
elif policy.Type == TitleProductType.LoanPolicy.Endorsement:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'END_Split1Loan_Percent_901045##')
elif policy.Type == TitleProductType.OwnersPolicy.Endorsement:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'END_Split1Owners_Percent_901045##')
if defaultsplit.Guid == defaultsplit2.Guid:
if policy.Type == TitleProductType.LoanPolicy:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'Split2Loan_Percent_901045##')
elif policy.Type == TitleProductType.OwnersPolicy:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'Split2Owners_Percent_901045##')
# BELOW FOR ENDORSEMENTS
elif policy.Type == TitleProductType.LoanPolicy.Endorsement:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'END_Split2Loan_Percent_901045##')
elif policy.Type == TitleProductType.OwnersPolicyEndorsement:
args.Value = IOrderItem.GetProperty(Order.TitleCompanies[0], 'END_Split2Owners_Percent_901045##')