高章伟
2022-03-10 8db20630a2675ca14e03ccdee91c614397b5c964
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?xml version="1.0" encoding="UTF-8"?>
<ValidationRule xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Must_Is_Class</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() || Ischanged(Account__c)) &amp;&amp; Not(Isblank(Account__c)) &amp;&amp;
OR (
/* 无效 ==&gt; 报错 */
Text(Hospital__r.Is_Active__c) == &quot;無効&quot;,
/* 看父记录,不是医院,不是经销商、 自己也不是医院 ==&gt; 报错 */
Not(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)
)</errorConditionFormula>
    <errorDisplayField>Account__c</errorDisplayField>
    <errorMessage>科室必须是战略科室下科室</errorMessage>
</ValidationRule>