binxie
2024-01-20 0a2fc19461a141fbbb2c303142afdee22c72daac
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?xml version="1.0" encoding="UTF-8"?>
<ValidationRule xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Hospital_Effective_Check</fullName>
    <active>true</active>
    <description>病院無効の場合、戦略科、診療科更新できません。(ただし、訪問件数などの積上げ項目が更新できる)</description>
    <errorConditionFormula>$Profile.Id != &quot;00e10000000Y3o5&quot;
&amp;&amp;
$Profile.Id != &quot;00e10000000dEQx&quot;
&amp;&amp;
NOT(
  /* 可以更新的字段 */
  OR(
    ISCHANGED(Service_contract_active_number__c),
    ISCHANGED(Service_contract_active_number_HP__c),
    ISCHANGED(Opportunity_amount__c)
  )
)
&amp;&amp;
IF (
  ISBLANK(ParentId),
  IF (
    RecordTypeId = &apos;01210000000QemG&apos;,
    IF (
      ISCHANGED(Is_Active__c),
      FALSE,
      IF (
        TEXT(Is_Active__c) = &apos;無効&apos;,
        TRUE,
        FALSE
      )
   ),
   FALSE  
  ),
  IF (
    Parent.RecordTypeId = &apos;01210000000QemG&apos;,
    IF (
      TEXT(Parent.Is_Active__c) = &apos;無効&apos;,
      TRUE,
      FALSE
    ),
    IF (
      ISBLANK(Parent.ParentId),
      FALSE,
      IF (
        Parent.Parent.RecordTypeId = &apos;01210000000QemG&apos;,
        IF (
          TEXT(Parent.Parent.Is_Active__c) = &apos;無効&apos;,
          IF (
            ISCHANGED(Is_Active__c) &amp;&amp; TEXT(Is_Active__c) = &apos;無効&apos;,
            FALSE,
            TRUE
          ),
          FALSE
        ),
        FALSE
      )
    )
  )
)
)</errorConditionFormula>
    <errorMessage>医院处于无效状态,不能做任何修改。</errorMessage>
</ValidationRule>