| | |
| | | public with sharing class LexStockCancelController { |
| | | public LexStockCancelController() { |
| | | |
| | | |
| | | } |
| | | @AuraEnabled |
| | | public static Opportunity init(String recordId){ |
| | | try{ |
| | | Opportunity item=[select |
| | | Opportunity item=[select |
| | | Stock_cancel_reason__c,Whether_Upload_Question_Document__c |
| | | from Opportunity |
| | | where id = :recordId]; |
| | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static UpdateResult updateOppotunity( |
| | | public static UpdateResult updateOppotunity( |
| | | String recordId, |
| | | String stStatus |
| | | ) { |
| | |
| | | Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest(); |
| | | req.setObjectId(recordId); |
| | | Approval.ProcessResult result = Approval.process(req); |
| | | if(result!=null&&result.getErrors()!=null&&result.getErrors().size()>0) return result.getErrors().get(0).getMessage(); |
| | | if(result.getErrors()!=null&&result.getErrors().size()>0)return result.getErrors().get(0).getMessage(); |
| | | }catch(Exception e){ |
| | | System.debug('LexStockCancelController submitApprovalRequest error: '+e.getMessage()); |
| | | return e.getMessage(); |
| | |
| | | @AuraEnabled public List<String> errors {get;set;} |
| | | } |
| | | public class InitData{ |
| | | |
| | | |
| | | } |
| | | } |
| | | } |