function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kakasaheb EKKakasaheb EK 

How to capture the system error message of Helper class in Salesforce.?

Hi All,
I have controller & Helperclass.
Here I am calling all DML operation in helper class through controller, but somes times error will come in Helper class
so I can't capture this system messages.
please give me soultion to capture the system messages(say validation error message).

Thanks in Advance.
Sachin.
Rohit K SethiRohit K Sethi
hi Sachin,

You can use try-catch block in helper class and 
whenever the error is occurs the cursor go into the catch section and you can return the error message.

Thanks.