Li Jun
2022-04-27 f90c63155656928b86f1ce1d91a134de3d12d2b9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0" encoding="UTF-8"?>
<ValidationRule xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Must_Is_DeptClas</fullName>
    <active>true</active>
    <description>必须填写该医院下的战略科室, opd计划上线时修改</description>
    <errorConditionFormula>$User.ProfileId &lt;&gt;&apos;00e10000000Y3o5&apos;
&amp;&amp;
NOT($User.Batch_User__c)
&amp;&amp;
Isnew() &amp;&amp; OR (
/* 看父记录,是医院,没有选相应的战略科室 ==&gt; 报错 */
AND(CASESAFEID(Account__r.RecordTypeId) = $Label.Department_ENT
|| CASESAFEID(Account__r.RecordTypeId) = $Label.Department_GI
|| CASESAFEID(Account__r.RecordTypeId) = $Label.Department_GS
|| CASESAFEID(Account__r.RecordTypeId) = $Label.Department_GYN
|| CASESAFEID(Account__r.RecordTypeId) = $Label.Department_OTH
|| CASESAFEID(Account__r.RecordTypeId) = $Label.Department_URO
|| CASESAFEID(Account__r.RecordTypeId) = $Label.Department_BF,
Account__r.ParentId &lt;&gt; Strategic_dept__c
)
)</errorConditionFormula>
    <errorDisplayField>Strategic_dept__c</errorDisplayField>
    <errorMessage>请选择相对应的战略科室</errorMessage>
</ValidationRule>