You need to sign in to do that
Don't have an account?
snodskov_secunia
Error Messages in Community
We are using Communities and have a Trigger in place preventing Users with certain Profiles from deleting specific records (in this case a Question record).
The Trigger uses "addError" to prevent a record from being deleted. So, in short, the code validates if the User trying to delete the Question has a Profile that allows this or not. If not, the record is marked using addError along with an error message.
This works perfectly for our internal users but when a Community User tries to delete a Question they get this error message instead of the more userfriendly one:
"An internal server error has occurred
Error ID: 201458473-277641 (853642360)"
My question is this: Do we need to do something special in order to display the userfriendly error message defined when calling addError?
Does it have to do with the latest release of Communities? We found that displaying validation errors also was a bit tricky with the latest release.
Thanks.
/Søren Nødskov Hansen
The Trigger uses "addError" to prevent a record from being deleted. So, in short, the code validates if the User trying to delete the Question has a Profile that allows this or not. If not, the record is marked using addError along with an error message.
This works perfectly for our internal users but when a Community User tries to delete a Question they get this error message instead of the more userfriendly one:
"An internal server error has occurred
Error ID: 201458473-277641 (853642360)"
My question is this: Do we need to do something special in order to display the userfriendly error message defined when calling addError?
Does it have to do with the latest release of Communities? We found that displaying validation errors also was a bit tricky with the latest release.
Thanks.
/Søren Nødskov Hansen
Could you please let me know if you are still facing this issue? If so, could you please provide me detailed replication steps?
Thanks,
Shashank
Salesforce.com
Thanks for getting back to me. It is still an issue for us so any help is much appreciated.
We run a Support Community using the Napili Community Template. In our SFDC Production Org. we have a Before Delete Trigger in place that prevents Users from deleting any records of the Question object. The trigger looks like this: The QuestionHandler looks like this: The ObjectDeletionAllowance__c is a Custom Setting of type Hierarchy with Protected visibility. However, I have tried removing the reference to that Custom Setting as well as the reference to the Custom Label called CantDeleteQuestions but that didn't change anything. The internal server error message was still the one that was shown.
I have also tried using question.Title.addError(Label.CantDeleteQuestions) in order to link the error message to a specific field but the result was the same. We still got the internal server error message instead of our own message.
Finally, i have also tried changing QuestionHandler to use the without sharing keyword instead but still no change.
To reproduce this error, do the following:
- Create a Before Delete Trigger on Question that uses addError to prevent Users from deleting any Question records
- Create Community using Napili Template
- Log in to the Community as a Community User
- Ask a Question
- Delete the Question
Let me know what you come up with and if you need any further info or details, please don't hesitate to contact me directly.Thanks.
Søren Nødskov
Could you please grant me login access and send me your org Id to ssrivatsavaya@salesforce.com so that I can investigate further on this issue?
I have now granted access for 1 week to Salesforce Support. Let me know if you need me to extend that period.
Thanks.
Søren Nødskov