<?xml version="1.0" encoding="UTF-8"?>
<ValidationRule xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>AWAL_CrossedAgreementDetailsValidation</fullName>
    <active>true</active>
    <description>Ensure CrossedAgreementDetails__c is populated when CrossedWithPriorAgreements__c
        is &apos;Conditionally&apos;.</description>
    <errorConditionFormula>AND(
        RecordType.DeveloperName = &quot;AWAL&quot;,
        NOT($Permission.AWAL_Bypass_VRs),
        NOT(ISPICKVAL(StageName, &quot;Deal Tracking&quot;)),
        NOT(ISPICKVAL(StageName, &quot;Deal Discussions&quot;)),
        NOT(AND(Is_Migrated__c, OR(ISPICKVAL(Migrated_From_Opportunity__r.StageName, "Pass to Approver (KLS only)"), ISPICKVAL(Migrated_From_Opportunity__r.StageName, "Passed to Finance"), ISPICKVAL(Migrated_From_Opportunity__r.StageName, "Passed to BA")))),
        ISPICKVAL(CrossedWithPriorAgreements__c, &quot;Conditionally&quot;),
        ISBLANK(CrossedAgreementDetails__c)
        )</errorConditionFormula>
    <errorDisplayField>CrossedAgreementDetails__c</errorDisplayField>
    <errorMessage>Crossed Agreement Details must be populated when Crossed With Prior Agreements is
        &apos;Conditionally&apos;,</errorMessage>
</ValidationRule>
