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
blackbirdblackbird 

Alert when validation not conform...

Hi,
I have a question about Apex code.  When I am creating a code to validate if a certain field (textbox) is respecting a certain rule, example: date needs to be a less than another date, and if not alert the user to re-enter it with a popup or some sort, how would I be able to go about it in ALERTING.
 
If it's possible to send me a sample code to clarify the process... it will be very APPRECIATED.
 
Thanks in advance to anyone who can help me on this.
Alen 
abhi_developerabhi_developer
Hi Blackbird,
 
If i am not wrong u want all your entered data intact on the page after the alert.
 
if u are using triggers to validate fields use addError("your error message") method to throw errors for you.
 
but this will not give popoup it will be shown after page refresh.
 
popup's can be implemented using "javascript"
 
Do reply me if it works, and if not reply with the details, lemme see how can i help you.
 
-Abhishek Singh
 
 
blackbirdblackbird
Hi Abhishek Singh,
Thanks for the reply, I figured out some things I can do with Validation Alerts, but your information will also be very useful somewhere down the line.

Thanks again,
Alen:smileytongue: