高章伟
2022-03-10 1312ba82d4c880bdb5357d28e0d4af5b285f610f
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
public without sharing class FollowTriggerHandler extends Oly_TriggerHandler{
    private Map<Id, Inquiry_form__c> newMap;
    private Map<Id, Inquiry_form__c> oldMap;
    private List<Inquiry_form__c> newList;
    private List<Inquiry_form__c> oldList;
    public FollowTriggerHandler() {
        this.newMap = (Map<Id, Inquiry_form__c>) Trigger.newMap;
        this.oldMap = (Map<Id, Inquiry_form__c>) Trigger.oldMap;
        this.newList = (List<Inquiry_form__c>) Trigger.new;
        this.oldList = (List<Inquiry_form__c>) Trigger.old;
        Integer i = 0;
    }
    protected override void afterUpdate() {
        followUpdate();
    }
    public void followUpdate(){
        Map<SObject,List<String>> data = new Map<SObject,List<String>>();
        List<ReportMemo__c> rmList = new List<ReportMemo__c>();
        for (Inquiry_form__c inquiry : newList) {
            List<String> strList = new List<String>();
            Inquiry_form__c oldInquiry = null;
            if (Trigger.isUpdate) {
                oldInquiry = oldMap.get(inquiry.Id);
            }
            if (oldInquiry == null || inquiry.Product1__c != oldInquiry.Product1__c) {
                strList.add('Product1__c');
            }
            data.put(inquiry, strList);
        }
        SplitOptionListUtil util = new SplitOptionListUtil();
        util.makeObject(data);
    }
}