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
25
26
27
28
29
30
31
32
<?xml version="1.0" encoding="UTF-8"?>
<ValidationRule xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>When_NFM103_With_Repairing</fullName>
    <active>true</active>
    <description>2016/11/10 add condition
  NOT(Delivered_Product__r.Product2.CanRepairAccsessary__c = true
   &amp;&amp; text(Delivered_Product__r.Asset_Owner__c) &lt;&gt; &quot;Olympus&quot;
2016/12/6 add condition
  Not Serial Tracing&amp;&amp;Not备品用途附属品</description>
    <errorConditionFormula>AND(
  OR(
    Text(Status__c)=&apos;草案中&apos;,
    Text(Status__c)=&apos;1.受理完毕&apos;
  ),
  OR(
    ISNEW(),
    AND(ISCHANGED(Status__c),  Text(PRIORVALUE(Status__c))=&apos;草案中&apos;)
  ),
  /* 已经有修理 */
   Delivered_Product__r.Repairing_Count__c &gt;= 1 ,
  /* 可以修理附属品=false&amp;&amp;备品&amp;&amp;Not Serial Tracing&amp;&amp;Not备品用途附属品)*/
   OR(
     Delivered_Product__r.Product2.CanRepairAccsessary__c = false,
     Delivered_Product__r.Product2.CanRepairAccsessary__c = true
     &amp;&amp; text(Delivered_Product__r.Asset_Owner__c) = &quot;Olympus&quot;
     &amp;&amp; Delivered_Product__r.Product2.Serial_Lot_No__c = &quot;S/N tracing&quot;
     &amp;&amp; Delivered_Product__r.Loaner_accsessary__c = false
)
)</errorConditionFormula>
    <errorDisplayField>Delivered_Product__c</errorDisplayField>
    <errorMessage>已经有受理完毕的修理,不能再受理了</errorMessage>
</ValidationRule>