<?xml version="1.0" encoding="UTF-8"?> 
 | 
<ValidationRule xmlns="http://soap.sforce.com/2006/04/metadata"> 
 | 
    <fullName>CanNotAssignTasksToNonSubordinaUsers</fullName> 
 | 
    <active>true</active> 
 | 
    <description>//2021-11-05  mzy  任务管理改善   
 | 
//校验 经理(服务) ,经理(推广),经理(备品),部长(推广),部长(服务),部长(备品),总监,统括总监  
 | 
//跳过管理员</description> 
 | 
    <errorConditionFormula>(IsNew()|| ISCHANGED( assignee__c ) )&&Text(taskDifferent__c)='上级分配任务'&&(assignee__r.JingliApprovalManager__c != $User.Id && assignee__r.SalesManager__c != $User.Id  && assignee__r.ManagerId != $User.Id 
 | 
&&  assignee__r.JingliEquipmentManager__c!= $User.Id  
 | 
 &&  assignee__r.BuchangApprovalManagerSales__c!= $User.Id && assignee__r.BuchangApprovalManager__c!= $User.Id && assignee__r.Buzhang_Equipment_Manager__c!= $User.Id && assignee__r.ZongjianApprovalManager__c!= $User.Id && assignee__r.TongkuoZongjian__c!= $User.Id 
 | 
)&&$User.ProfileId != '00e10000000Y3o5'</errorConditionFormula> 
 | 
    <errorMessage>您只能给您的下属分配任务</errorMessage> 
 | 
</ValidationRule> 
 |