binxie
2024-01-22 102afa21c115e8c8b9333a326c3d1af08fe76faf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?xml version="1.0" encoding="UTF-8"?>
<ValidationRule xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Allow_associated_inquiries</fullName>
    <active>true</active>
    <description>考虑历史数据原因,加时间判断,创建日期大于上线时的日期(2023.08.17)</description>
    <errorConditionFormula>AND( DATEVALUE(CreatedDate) &gt;  DATE(2023,8,17),OR(TEXT( Opportunity_repeated__r.StageName ) =&apos;目標&apos;,
TEXT( Opportunity_repeated__r.StageName ) =&apos;注残&apos;,
AND(OR(TEXT( Opportunity_repeated__r.StageName ) =&apos;出荷&apos;,TEXT( Opportunity_repeated__r.StageName )  =&apos;完了&apos;),
    OR( Opportunity_repeated__r.Shipping_Date_For_Report__c &lt; DATE(IF(MONTH(TODAY()) &lt;= 3,YEAR(TODAY()) - 1, YEAR(TODAY())), 4, 1),
    Opportunity_repeated__r.Shipping_Date_For_Report__c &gt;= DATE(IF(MONTH(TODAY()) &lt;= 3, YEAR(TODAY()), YEAR(TODAY()) + 1), 4, 1))),
AND(OR(TEXT( Opportunity_repeated__r.StageName ) =&apos;敗戦&apos;,TEXT( Opportunity_repeated__r.StageName ) =&apos;削除&apos;) ,
    OR( Opportunity_repeated__r.Final_Contract_Proceeded_Date__c&lt; DATE(IF(MONTH(TODAY()) &lt;= 3,YEAR(TODAY()) - 1, YEAR(TODAY())), 4, 1),
    Opportunity_repeated__r.Final_Contract_Proceeded_Date__c &gt;= DATE(IF(MONTH(TODAY()) &lt;= 3, YEAR(TODAY()), YEAR(TODAY()) + 1), 4, 1)))))</errorConditionFormula>
    <errorDisplayField>Opportunity_repeated__c</errorDisplayField>
    <errorMessage>允许关联的询价,发货,完毕(完毕时间在本财年的),失单,取消(失单取消在本财年的)</errorMessage>
</ValidationRule>