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


Is there way to send a message to the user from the Apex code like the "Alert" function in javascript when you are running pagereference funcitons?
Yes! You can write error/info messages to the user via Apex using  ApexPages.addMessage.

You see an example of this by clicking the "See Results" button on the following example. Do a search but do not check any of the checkboxes. The code essentially ensures that at least one checkbox is selected before viewing the results.

The code that fires this is on line 64 of the CategorySearchController:

Jeff Douglas
Informa Plc