<?xml version="1.0" encoding="UTF-8"?> 
 | 
<ValidationRule xmlns="http://soap.sforce.com/2006/04/metadata"> 
 | 
    <fullName>work_location_select_self_or_4RC</fullName> 
 | 
    <active>true</active> 
 | 
    <description>受理办事处只能选自己省内的办事处 或 七大RC</description> 
 | 
    <errorConditionFormula>$Profile.Id != '00e10000000dEQx'   /* GPI_系统管理员 不报错 */ 
 | 
&& 
 | 
$User.Id != '00510000000fSYI'   /* Batch User 不报错 */ 
 | 
&& 
 | 
OR(Text(Status__c) = '草案中', IsBlank(Text(Status__c)))   /* 草案中 だけチェックする */ 
 | 
&& 
 | 
ISBLANK(Text(work_location_select__c)) = False 
 | 
&& 
 | 
ISBLANK(Incharge_Staff__c) = False 
 | 
&& 
 | 
/* 备品不报错(可以选任何RC) */ 
 | 
Not(Delivered_Product__r.RecordTypeId='01210000000kOPR') 
 | 
&& 
 | 
/* 受理办事处只能选自己省内的办事处 或 四大RC */ 
 | 
IF(Text(work_location_select__c)='北京办事处', False, 
 | 
IF(Text(work_location_select__c)='沈阳办事处', False, 
 | 
IF(Text(work_location_select__c)='上海办事处', False, 
 | 
IF(Text(work_location_select__c)='广东办事处', False, 
 | 
IF(Text(work_location_select__c)='杭州办事处', False, 
 | 
IF(Text(work_location_select__c)='杭州共通办事处', False, 
 | 
IF(Text(work_location_select__c)='西安办事处', False, 
 | 
IF(Text(work_location_select__c)='西安共通办事处', False, 
 | 
IF(Text(work_location_select__c)='成都办事处', False, 
 | 
IF(Text(work_location_select__c)='成都共通办事处', False, 
 | 
IF(Text(work_location_select__c)='共通办事处', False, 
 | 
IF(Text(work_location_select__c)=Incharge_Staff__r.RepairSalesPoint_Province_China__c, False, 
 | 
  True) 
 | 
)))))))))))</errorConditionFormula> 
 | 
    <errorDisplayField>work_location_select__c</errorDisplayField> 
 | 
    <errorMessage>受理办事处只能选自己省内的办事处 或 七大RC</errorMessage> 
 | 
</ValidationRule> 
 |