| | |
| | | * @Author: chen jing wu |
| | | * @Date: 2023-04-12 11:16:07 |
| | | * @LastEditors: chen jing wu |
| | | * @LastEditTime: 2023-10-19 16:29:00 |
| | | * @LastEditTime: 2023-10-26 20:30:06 |
| | | */ |
| | | public with sharing class OpportunityLightingButtonController { |
| | | @AuraEnabled |
| | |
| | | update opp; |
| | | return null; |
| | | } catch (Exception e) { |
| | | return e.getDmlMessage(0); |
| | | return errorMessage(e); |
| | | } |
| | | } |
| | | @AuraEnabled |
| | |
| | | update opp; |
| | | return null; |
| | | } catch (Exception e) { |
| | | return e.getDmlMessage(0); |
| | | return errorMessage(e); |
| | | } |
| | | } |
| | | @AuraEnabled |
| | |
| | | update opp; |
| | | return null; |
| | | } catch (Exception e) { |
| | | return e.getDmlMessage(0); |
| | | return errorMessage(e); |
| | | } |
| | | } |
| | | @AuraEnabled |
| | |
| | | update opp; |
| | | return null; |
| | | } catch (Exception e) { |
| | | return e.getDmlMessage(0); |
| | | return errorMessage(e); |
| | | } |
| | | } |
| | | @AuraEnabled |
| | |
| | | processResults.add(Approval.process(request)); |
| | | return processResults[0].errors; |
| | | } catch (Exception e) { |
| | | return e.getDmlMessage(0); |
| | | return errorMessage(e); |
| | | } |
| | | } |
| | | @AuraEnabled |
| | |
| | | ]; |
| | | return user.Id; |
| | | } catch (Exception e) { |
| | | return e.getDmlMessage(0); |
| | | if (e.getMessage().contains(',')) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| | | @AuraEnabled |
| | |
| | | ]; |
| | | return pro.Id; |
| | | } catch (Exception e) { |
| | | return e.getDmlMessage(0); |
| | | if (e.getMessage().contains(',')) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | } |
| | | @AuraEnabled |
| | |
| | | return '1'; |
| | | } catch (Exception ex) { |
| | | Database.rollback(sp); |
| | | return ex.getDmlMessage(0); |
| | | return errorMessage(ex); |
| | | } |
| | | } |
| | | @AuraEnabled |
| | |
| | | return false; |
| | | } |
| | | |
| | | public static string errorMessage(Exception e){ |
| | | if (e.getMessage().contains(',')) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | | String exc = '' + e.getMessage(); |
| | | Integer left = exc.indexOf(':') + 1; |
| | | Integer right = exc.lastIndexOf(':'); |
| | | String str = exc.substring(left,right); |
| | | left = str.indexOf(',') + 1; |
| | | String newStr = str.substring(left); |
| | | return newStr; |
| | | }else { |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public Boolean directLossFLG; |