涂煌豪
2022-05-06 ff435968945d457f9ee653a9620fa1c7d78d2d4c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?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>必须填写该医院下的战略科室</description>
    <errorConditionFormula>$User.ProfileId &lt;&gt;&apos;00e10000000Y3o5&apos; 
&amp;&amp; 
NOT($User.Batch_User__c) 
&amp;&amp;
Isnew() &amp;&amp; OR ( 
/* 看父记录,是医院,没有选相应的战略科室 ==&gt; 报错 */ 
AND(Account__r.Parent.Parent.RecordTypeId = &quot;01210000000QemG&quot;, 
Account__r.ParentId &lt;&gt; Strategic_dept__c 
)</errorConditionFormula>
    <errorDisplayField>Strategic_dept__c</errorDisplayField>
    <errorMessage>请选择相对应的战略科室</errorMessage>
</ValidationRule>