Exceptions/Requirements – Handling multiple references to order objects
Posted: Thu Oct 06, 2022 5:02 pm
We utilize automation code snippets to add Requirements/Exceptions to orders if certain criteria are met. Thus far, we have been able to achieve this when the Exception/Requirement content is straight text or it pulls from a very specific data field from the order. We are running into an issue when trying to add a Requirement/Exception that contains field codes that match more than one reference on the order.
Example field code from a requirement: {{Order.ExistingLiens.Mortgagee}} In this field code example, if there is more than one ExistingLien on an order, and we attempt to manually add the requirement, we are prompted with the following (see attached image): We are using the following syntax when adding a requirement/exception to an order:
Is there a way we can programmatically handle this type of scenario in an automation code snippet, to reference a specific ExistingLien object, when adding a Requirement/Exception to an order?
Thank you.
Example field code from a requirement: {{Order.ExistingLiens.Mortgagee}} In this field code example, if there is more than one ExistingLien on an order, and we attempt to manually add the requirement, we are prompted with the following (see attached image): We are using the following syntax when adding a requirement/exception to an order:
Code: Select all
# Create instance of a requirement.
requirement = IOrder.CreateNew(Context, ‘Requirement’)
requirement.Code = TARGET_LOOKUP_CODE
# Add new requirement to list of all requirements.
order_commitment_requirements = Context.Title.TitleInsuranceCalculations[0].Commitment.Requirements
order_commitment_requirements.Add(requirement)
Is there a way we can programmatically handle this type of scenario in an automation code snippet, to reference a specific ExistingLien object, when adding a Requirement/Exception to an order?
Thank you.