Skip to main content
Rasmita Rani Sahoo (salesforce) 님이 #Apex에 질문했습니다
How to write the exception, if the employee id and EmpName is there or not. If the Emp id is not there then throw the user-friendly message which one is understand by Enduser.(using Slaesforce using custom controller class).And that EmpID is a standard field(Auto generated).
답변 2개
  1. 2022년 5월 30일 오후 1:49
    HI Rasmita,

    The question is quite broad. You might want to add what you have tried so far and where exactly you are stuck. If you are trying to Create Custom Exceptions, see the example code on https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_exception_custom.htm to get started.

    About

    Returning Errors from an Apex Server-Side Controller: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/controllers_server_apex_custom_errors.htm

    Related: https://salesforce.stackexchange.com/questions/179127/try-catch-blocks-within-a-custom-controller

    If this information helps, please mark the answer as best. Thank you
0/9000