HTML tags in the error message are escaped even if escape = false is specified at sObject.addError() in Lightning UI and Salesforce1
Last updated 2018-05-21 ·Reference W-3269770 ·Reported By 4 users
No Fix
Summary
HTML tags in the error message are escaped even if escape = false is specified at sObject.addError() in the Lightning UI and Salesforce1.
- Actual Result
The html tags in the error message are escaped.
- Expected Result
The error message is handled as html text.
Repro
1. Sign up a DE org
2. Create a trigger as following,
trigger CaseSaveError on Case (before update) {
trigger.new[0].addError('Something went wrong ! <a href=\'https://www.salesforce.com\'> click me </a>',false);
}
3. Switch to the Lightning UI or Salesforce1
4. Create a case and edit it
5. Hit save
You will see the error message which contains escaped html tags.
Workaround
N/A
This limitation has been documented at https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_sobject.htm#apex_System_SObject_field_addError.
Reported By (4)
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.