function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TejTej 

command link in apex error message

can we put a commandlink in apex error message?

when user gets an error message it contain a clickable content/commandlink ,which should open a popup with instructions.

is it possible to add commandlink in errormessage??
logontokartiklogontokartik
Yes you can.
On your <apex:pageMessages id="theMessages" escape="false"/> make sure you add escape="false" and in your controller when you add Error
on ApexPages.addMessage you can use HTML Text.
Something like 
String htmlText = 'Case successfully created <a href="#" id="'+newCase.Id+'" class="newCaselink">View Case</a>';

		ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info, htmlText));


TejTej
can we add an action method? and on click of the link it opens a popup?