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
AnnuAnnu 

Cancel button not working in vf page

I am creating a vf page to create New Event records. I have a cancel button on the page. when i click on the cancel button, it should take me to home page. but here what result I am getting is, instead of redirecting me to home page,when i click on cancel button it is asking me to enter value for mandatory fields. once i enter mandatory field values and click on cancel, it is redirecting me to home page. the error is "you must enter a value" for start datetime,end date time and  subject. i am referring to standard fields directly on the page.

 

Kindly help me in resolving this issue asap.

 

Thank you

anny

Best Answer chosen by Admin (Salesforce Developers) 
Navatar_DbSupNavatar_DbSup

Hi,

 

To override the mandatory field validation when a button pressed on the Vf page. you can override by setting the immediate=”true” attribute of the command button

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

 

All Answers

Navatar_DbSupNavatar_DbSup

Hi,

 

To override the mandatory field validation when a button pressed on the Vf page. you can override by setting the immediate=”true” attribute of the command button

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

 

This was selected as the best answer
AnnuAnnu

Thank you. :) it works.