I'm trying to add criteria to an automation snippet based on the below code snippet. I would like the system to check the Buyer contacts in the case of a purchase, and the lender contact in the case of a Refinance. If the contact name is "TBD" or "To be determined" the return should be false.
from System import *
from SoftPro.ClientModel import *
from SoftPro.Select.Client import *
from SoftPro.OrderTracking.Client.Orders import *
def OrderContactsNotTBD():
if Context.TransactionType = 'Purchase':
return True
for contact in Context.Buyers:
if contact.Name == 'TBD' or contact.Name == 'To be determined':
return False
else:
return True
OrderContactsNotTBD()
# For Purchase transactions this checks the Buyer names
# For Refinance transactions this checks the Lender names
# If at least one Contact has the name 'TBD' or 'To be determined' it returns False
# For everything else it returns True
def OrderContactsNotTBD():
if Context.TransactionType == TransactionType.Purchase:
for contact in Context.Buyers:
if contact.Name == 'TBD' or contact.Name == 'To be determined':
return False
elif Context.TransactionType == TransactionType.Refinance:
for contact in Context.Lenders:
if contact.Name == 'TBD' or contact.Name == 'To be determined':
return False
return True