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
RMS@NCRMS@NC 

Help with display of error message

Hi,
I'm a newbie here. Maybe its a simple silly thing..but please help!
> There is a custom object, say Student__c. There is a field called 'Account Number__c' in this object. 
> On record creation and update, I need to check if this 'Account number' is present in another object (Background Check__c). If present, I need to show a warning message (The orange colour one). 
> I'm using a trigger which calls an apex class and is checking the field using DML.
> Also I created a VFP to just display the error message ( Using apex pageMessages)
> I'm unable to pass error message from this trigger to VFP.
> Is there a way to do so ? (I don't want to use .addError)
> Or, is there a way that I can directly call an apex class from my VFP wihtout a button (Since VFP is only for display of error message, there is no button)

Please help!