| | |
| | | return res; |
| | | } |
| | | @AuraEnabled |
| | | public static InitData initForOpporSpliteButton(String recordId){ |
| | | InitData res = new InitData(); |
| | | try { |
| | | Opportunity oppo = [ |
| | | select |
| | | Authorized_DB_No__c, |
| | | Estimation_Decision__c, |
| | | SI_Decide_ID__c, |
| | | Name, |
| | | Opportunity_No__c, |
| | | IsAuthorized__c |
| | | from Opportunity where Id =: recordId |
| | | ]; |
| | | res.authorizedDBNo = oppo.Authorized_DB_No__c; |
| | | res.estimationDecision = oppo.Estimation_Decision__c; |
| | | res.siDecideID = oppo.SI_Decide_ID__c; |
| | | res.name = oppo.Name; |
| | | res.opportunityNo = oppo.Opportunity_No__c; |
| | | res.isAuthorized = oppo.IsAuthorized__c; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | return res; |
| | | } |
| | | @AuraEnabled |
| | | public static string updateForAgencyAuthorizeButton(String recordId){ |
| | | try { |
| | | Opportunity opp = new Opportunity(); |
| | |
| | | } |
| | | return fields; |
| | | } |
| | | @AuraEnabled |
| | | public static Object submitProcess(String opportunityId) { |
| | | try { |
| | | Approval.ProcessSubmitRequest request = new Approval.ProcessSubmitRequest(); |
| | | request.setObjectId(opportunityId); |
| | | Approval.ProcessResult[] processResults = new Approval.ProcessResult[] {}; |
| | | processResults.add(Approval.process(request)); |
| | | return processResults[0].errors; |
| | | } catch (Exception e) { |
| | | String eMessage = e.getMessage(); |
| | | Integer left = eMessage.indexOf(',') + 1; |
| | | Integer right = eMessage.length(); |
| | | return eMessage.substring(left,right); |
| | | } |
| | | } |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public Boolean directLossFLG; |
| | |
| | | public String opportunityCategory; |
| | | @AuraEnabled |
| | | public String agency1Name; |
| | | @AuraEnabled |
| | | public String authorizedDBNo; |
| | | @AuraEnabled |
| | | public String siDecideID; |
| | | @AuraEnabled |
| | | public String opportunityNo; |
| | | } |
| | | } |