buli
2022-03-10 a90c9ecfc5118547d0a92b2fee2779eca95e09a5
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
global class NewAndEditInquiryFormController extends NewAndEditBaseController 
{
    // public String contactsInfo {set;get;}//key sfid;value awsid
    // public String leadsInfo {set;get;}//key sfid;value awsid
    public String PIPL_Input_Account_Error_Msg{set;get;}
    public String contactId{set;get;}//For Lookup field
    public String leadId{set;get;}//For Lead Lookup
    public String staticResourceContact {get; set;}
    public String staticResourceLead {get; set;}
    public NewAndEditInquiryFormController(ApexPages.StandardController controller) {
        List<String> fieldList = new List<String>(Schema.getGlobalDescribe().get('Inquiry_form__c').getDescribe().fields.getMap().keyset());  
        // Add fields to controller. This is to avoid the SOQL error in visualforce page
        controller.addFields(fieldList);
        // contact lookup
        LookUpOverrideFields.add('Contact_Name__c');
        LookUpOverrideFields.add('Lead_link__c');
        Init(controller.getRecord());
        //添加项
        PIPL_Input_Account_Error_Msg = label.PIPL_Input_Account_Error_Msg;
        SObject obj = controller.getRecord();
        if(obj.Id == null){
            //初始化加载值
            obj.put('OwnerId',UserInfo.getUserId());
        }
        //contact信息(搜索查询query url用)
        staticResourceContact = JSON.serialize(PIHelper.getPIIntegrationInfo('Contact'));
        //Lead信息(搜索查询query url用)
        staticResourceLead = JSON.serialize(PIHelper.getPIIntegrationInfo('Lead'));
    }
 
    
    @RemoteAction
    global static Response saveInquiryForm(String leadJson,String transId,Boolean isNew) {
        return save(new Inquiry_form__c(),leadJson,transId,isNew);
    }
}