[SalesForce] how to add email id as hyperlink in trigger error message

How can I add an email id as a hyperlink in a error message in a trigger?

Best Answer

You shouldn't.

Triggers are executing when your data is manipulated, from whatever context (UI or API). It would be a bad design to assume which interface is the source of your trigger execution and create user specific messages at that point.

That beeing said, that doesn't always applies to salesforce, as for standard pages you don't have the luxery of running custom controllers, and validation rules kinda skip the same principle.

ALSO: mailto hyperlinks are not perceived as user friendly by most users and often only work well with device installed email clients, and not with web email clients (I believe).

Related Topic