| <?xml version="1.0" encoding="UTF-8"?> | 
| <ValidationRule xmlns="http://soap.sforce.com/2006/04/metadata"> | 
|     <fullName>New_FromOPD_AccountEquals</fullName> | 
|     <active>true</active> | 
|     <description>从OPD计划创建备品申请时,检查备品申请中的科室是否与OPD计划中的科室一致 | 
| update lxy 20210114  分单不触发验证规则 添加了ISBLANK(Old_Rental_Apply__c )条件</description> | 
|     <errorConditionFormula>((isnew() && ISBLANK(Old_Rental_Apply__c ))|| ISCHANGED(Account__c)|| ISCHANGED(OPDPlan__c) ) | 
| &&Not(ISBLANK(OPDPlan__c)) | 
| &&Not(ISBLANK(OPDPlan__r.Account_Laboratory__c )) | 
| && (OPDPlan__r.Account_Laboratory__c != Account__c)</errorConditionFormula> | 
|     <errorDisplayField>Account__c</errorDisplayField> | 
|     <errorMessage>请检查备品申请中的科室是否与OPD计划中的科室一致</errorMessage> | 
| </ValidationRule> |