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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
public with sharing class lexSolutionProgrammeController {
    @AuraEnabled
    public static InitData initSubmitSolutionSchemeForApprovalButton(String recordId){
        InitData res = new InitData();
        try {
            Solution_Programme__c so = [
                select
                Scheme_Type__c,
                Confirmation_Result__c
                from Solution_Programme__c where Id =: recordId
            ];
            res.schemeType = so.Scheme_Type__c;
            res.confirmationResult = so.Confirmation_Result__c;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    @AuraEnabled
    public static List<solutionClosingAttachment__c> queryForAttachments(String Id){
        List<solutionClosingAttachment__c> so = new List<solutionClosingAttachment__c>();
        try {
            so = [select id,name from solutionClosingAttachment__c where Solution_Programme__c =: Id];
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return so;
    }
 
    @AuraEnabled
    public static string updateSubmitSolutionSchemeForApprovalButton(String recordId){
        Solution_Programme__c so = new Solution_Programme__c();
        try {
            so.Id = recordId;
            so.Submint_TF__c = true;
            update so;
            return '';
        } catch (Exception e) {
            return e.getMessage();
        }
    }
    class InitData{
        @AuraEnabled
        public String schemeType;
        @AuraEnabled
        public String confirmationResult;
    }
}