19626
2023-06-26 cb676d5d9631864b9fd634f9b3052a17c41ed345
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
public with sharing class lexAccountController {
    @AuraEnabled
    public static InitData initForNewSolutonProButton(String recordId){
        InitData res = new InitData();
        try {
            Account acc = [
                select
                Id, 
                Hospital__r.Salesdepartment_HP__c,
                Hospital__r.Id, 
                Hospital__r.OCM_Category__c
                from Account where Id =: recordId
            ];
            res.hospitalSalesdepartmentHP = acc.Hospital__r.Salesdepartment_HP__c;
            res.hospitalId = acc.Hospital__r.Id;
            res.hospitalOCMCategory = acc.Hospital__r.OCM_Category__c;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    class InitData{
        @AuraEnabled
        public String hospitalSalesdepartmentHP;
        @AuraEnabled
        public String hospitalId;
        @AuraEnabled
        public String hospitalOCMCategory;
    }
}