Activity Forums Salesforce® Discussions How to generate a custom error message in Salesforce lightning?

  • Aditya

    Member
    August 6, 2020 at 3:54 pm
    public with sharing class SampleClass {
    
        
        @AuraEnabled 
        public static Case resetCase(string recordId){
            
    		try{
    			
    			
    		}catch(Exception e){
    			
    			            throw new AuraHandledException('Error Exception happend'+e.getMessage());           
    
    		}
    		
        }
    }

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos