buli
2023-05-23 07390e2fcb4adf27c928335bf27ae7939c5a80ad
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
public with sharing class otherButtonSpotInspectionReportCtl {
    public otherButtonSpotInspectionReportCtl() {
 
    }
 
    @AuraEnabled
    public static InitData init(String recordId){
        InitData res = new initData();
        try{
            Inspection_Report__c report =  [SELECT Id,RecordTypeId,RecordType.DeveloperName FROM Inspection_Report__c WHERE Id =: recordId LIMIT 1];
            System.debug(LoggingLevel.INFO, '*** opp: ' + report);
            res.Id = report.Id;
            res.RecordTypeId = report.RecordTypeId;
            res.RecordType = report.RecordType.DeveloperName;
          
            System.debug(LoggingLevel.INFO, '*** res: ' + res);
        }catch(Exception e){
            System.debug(LoggingLevel.INFO, '*** e: ' + e);
        }
        return res;
    }   
 
    public class InitData{
        @AuraEnabled
        public String Id;
        @AuraEnabled
        public String RecordTypeId;
        @AuraEnabled
        public String RecordType;
     }
}