COR for Attorney contacts - Need help with def a custom field
Posted: Wed Nov 01, 2023 3:47 pm
Hi,
This is the first COR I am trying on my own. By looking at our existing CORs and the devforum I was able to get the code for the first part working. We need an error message if the attorney contact information is missing the "Represents" field.
Now I want to do the same if our custom field AttorneyType## is blank. I am not sure I understand how to define the custom field.
This is the first COR I am trying on my own. By looking at our existing CORs and the devforum I was able to get the code for the first part working. We need an error message if the attorney contact information is missing the "Represents" field.
Now I want to do the same if our custom field AttorneyType## is blank. I am not sure I understand how to define the custom field.
Code: Select all
# Attorney Contact Missing Data Error
# Require Attorney contact to have Represents
# Require Attorney contact to have an attorney type (Order : Attorney : AttorneyType## custom field)
def Order_Attorneys_Validate(args):
order = args.Context
# Check every attorney contact and see if the Represents field is not blank
for attorney in order.Attorneys:
if attorney.Represents is None or attorney.Represents == "":
args.RaiseError('Attorney Contact must have data in the Represents field')
return
def AttorneyType(args):
## ?
# Check every attorney contact and see if the AttorneyType custom field is not blank
for attorney in order.Attorneys:
if AttorneyType is None or AttorneyType == "":
args.RaiseError("Attorney Type is blank.")
return
# Redefine custom field
AttorneyType.__name__ = "Attorney_AttorneyType##_Value"