You need to sign in to do that
Don't have an account?

how to remove '. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION,' this text from my UI in lwc
Hello Everyone ,
I need to remove catch error from my LWC . So basically I have a record edit from and upon submitting i have some validation rules to be checked . So as we know for custom validations Salesforce adds this line First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION,' before any validation but my requirement is to show only the validation rule's message not the whole line .
Is there any way to show only validation message . Please help.
Thanks in advance.
Hello,
I got the exact answer. If anyone wants to refer : -
All Answers
Can you check different approaches mentioned on stack exchange.
https://salesforce.stackexchange.com/questions/312612/validation-rule-error-message-not-displaying-in-lwc-updaterecord-toast-event
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
Hello,
I got the exact answer. If anyone wants to refer : -
FIELD_CUSTOM_VALIDATION_EXCEPTION" in your LWC UI, it means that a custom validation rule has been triggered and it has caused an error.
To remove this error message from your UI, you will need to address the underlying cause of the error. Here are some steps you can follow:
- Determine the cause of the error: Look at the error message to determine what caused the custom validation rule to trigger. It may be that some data that was entered is not meeting a specific validation criteria.
- Modify the data to meet validation criteria: If the error was caused by incorrect data, modify the data to meet the validation criteria. This could involve making changes to the input or updating data in related records.
- Disable the validation rule (temporarily): If you are unable to modify the data to meet the validation criteria, you can temporarily disable the validation rule. However, this should only be done as a last resort, and the rule should be re-enabled once the issue has been resolved.
- Test the changes: After making changes to address the underlying cause of the error, test the changes to ensure that the error message no longer appears in the UI.
Note that if the error message is still appearing even after you have addressed the underlying cause of the error, there may be an issue with the custom validation rule itself. In this case, you may need to contact the administrator or developer who created the rule for assistance. If you want to get expert suggestion, you may connect salesforce consulting partners (https://www.streamssolutions.com/partnership/salesforce/) here.