Add endorsement to file
Posted: Thu Jan 04, 2024 7:07 am
Hi,
I'm using the below formula to add an endorsement to files where this endorsement is not already in the file. My issue is that it's adding the endorsement even when it already exists in the file. Does something in the below coding need to be revised?
Thank you,
I'm using the below formula to add an endorsement to files where this endorsement is not already in the file. My issue is that it's adding the endorsement even when it already exists in the file. Does something in the below coding need to be revised?
Thank you,
Code: Select all
from System import *
from SoftPro.ClientModel import *
from SoftPro.Select.Client import *
from SoftPro.OrderTracking.Client.Orders import *
# Add Endorsement "WV-STG-ALTA 13.1" if it does not exist.
# Context = Order
def NeedsEndorsements():
HasEND = False #Set the overall Variable to False
##Check to see if the Endorsement Code Already Exists
#for endorsement in Context.Title.Policies[0].Endorsements:
# # If a Endorsement Has no Code, go to the next one to evaluate
# if not endorsement.LookupCode:
# continue
# else:
# if endorsement.LookupCode == 'ENDORS_WV_11':
# HasEND = True
# Run the AddEndorsement Function if the Endorsement Variable is False.
if HasEND == False:
AddEndorsement('ENDORS_WV_11')
def AddEndorsement(code):
end = IOrder.CreateNew(Context, 'Endorsement')
end.LookupCode = code
endorsements = Context.Title.Policies[0].Endorsements
endorsements.Add(end)
NeedsEndorsements()