liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
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 with sharing class lexCaseController {
    @AuraEnabled
    public static InitData initForCreateVOCFromCIC(String recordId){
        InitData res = new InitData();
        try {
            Case ca = [
                select
                Department__c,
                Account__c,
                CICName__c
                from Case where Id =: recordId
            ];
            res.department = ca.Department__c;
            res.accountId = ca.Account__c;
            res.caseNumber = ca.CICName__c;
            res.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_VOC).getRecordTypeId();
            // res.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().toString();
        } catch (Exception e) {
            System.debug(e.getMessage());
        }
        return res;
    }
    public class InitData{
        @AuraEnabled
        public String department;
        @AuraEnabled
        public String accountId;
        @AuraEnabled
        public String recordTypeId;
        @AuraEnabled
        public String caseNumber;
    }
}