binxie
2024-01-20 1d91be0be5220ce19ee64de5a5c9a8237b1c15b1
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
64
65
66
67
68
69
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
    <fullName>Extend_Gurantee_DateTo__c</fullName>
    <description>if( New_logic_data__c, 
/* 新数据逻辑 */
IF(IS_Extend_Gurantee_Txt__c|| Text(warrantyType__c) = &apos;市场多年保修&apos; , 
    if(IS_Extend_Gurantee_Txt__c,
           /* 服务多年保修 多年保修期至 = 保修期限 */
           Guarantee_period_formula__c,
           /* 市场多年保修 多年保修期至 使用固定3年 */
           IF( AND( Not(ISBLANK(EntryDate__c)) ,EntryDate__c  &lt;= Posting_Date__c +100) ,
               ADDMONTHS( InstallDate , 3 * 12 ) ,
               ADDMONTHS( Posting_Date__c , 3 * 12 ) + 7))
, null)
 , 
/* 老数据原有逻辑保留 */
IF(IS_Extend_Gurantee_Txt__c==true 
,DATE(IF(ISBLANK(InstallDate) 
,YEAR(Posting_Date__c) 
,YEAR(InstallDate) 
) + 
CASE(Product2.Entend_gurantee_period__c 
,&apos;两年&apos;,2 
,&apos;三年&apos;,3 
,&apos;四年&apos;,4 
,&apos;五年&apos;,5 
,0 
, MONTH(Guarantee_period_for_products__c) 
, DAY(Guarantee_period_for_products__c) 
,null 
)
)</description>
    <externalId>false</externalId>
    <formula>if( New_logic_data__c, 
/* 新数据逻辑 */
IF(IS_Extend_Gurantee_Txt__c|| Text(warrantyType__c) = &apos;市场多年保修&apos; , 
    if(IS_Extend_Gurantee_Txt__c,
           /* 服务多年保修 多年保修期至 = 保修期限 */
           Guarantee_period_formula__c,
           /* 市场多年保修 多年保修期至 使用固定3年 */
           ADDMONTHS( InstallDate__c , ProvistonPeriod__c * 12 ))
, null)
 , 
/* 老数据原有逻辑保留 */
IF(IS_Extend_Gurantee_Txt__c==true 
,DATE(IF(ISBLANK(InstallDate) 
,YEAR(Posting_Date__c) 
,YEAR(InstallDate) 
) + 
CASE(Product2.Entend_gurantee_period__c 
,&apos;两年&apos;,2 
,&apos;三年&apos;,3 
,&apos;四年&apos;,4 
,&apos;五年&apos;,5 
,0 
, MONTH(Guarantee_period_for_products__c) 
, DAY(Guarantee_period_for_products__c) 
,null 
)
)</formula>
    <label>多年保修期至</label>
    <required>false</required>
    <trackHistory>false</trackHistory>
    <type>Date</type>
</CustomField>