<?xml version="1.0" encoding="UTF-8"?> 
 | 
<ValidationRule xmlns="http://soap.sforce.com/2006/04/metadata"> 
 | 
    <fullName>Is_Active_Account</fullName> 
 | 
    <active>false</active> 
 | 
    <description>XFUU-ALKARY对应停用</description> 
 | 
    <errorConditionFormula>(Isnew() || Ischanged(Account__c)) && Not(Isblank(Account__c)) && OR ( 
 | 
/* 无效  ==> 报错 */ 
 | 
Account__r.Is_Active_Formula__c == "无效", 
 | 
/* 看父记录,不是医院,不是经销商、 自己也不是医院  ==> 报错 */ 
 | 
Not( 
 | 
  OR(Account__r.Parent.Parent.RecordTypeId = "01210000000QemG", 
 | 
        Account__r.RecordTypeId = "01210000000QemG", 
 | 
        Account__r.RecordTypeId = "01210000000Qem1") 
 | 
  ) 
 | 
)</errorConditionFormula> 
 | 
    <errorDisplayField>Account__c</errorDisplayField> 
 | 
    <errorMessage>请选择有效的科室或经销商</errorMessage> 
 | 
</ValidationRule> 
 |