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
vanessavanessa 

Dont display a visualforce page if a field is missing

Hi.

To prevent the user of generate a visualforce page ( it's a customizing quote) without a number of quote what i have to do?

Im on the opportunity, and i click on a customize button and than create a quote .pdf. I dont want to create the .pdf if the field "numero_proposta" is not generate - cant be obligatory on the Opportunity.

 

Can u help me please?

Ispita_NavatarIspita_Navatar

On the click of the "Customize"  button can't you check the field value if it is not there you can just return a null Page-reference else continue with your normal execution.

 

I have assumed that you are implying that the field "numero_proposta" does not have a value or is null or empty.

 

In case that is not the case that is you literally are implying non-existence of field "numero_proposta" then ,may be you access it in a try block and if present to the normal action in the next line else if the field doesnot exist it will generate an exception and will to the catch block where you can reload the page by giving an appropriate error message.

 

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

vanessavanessa

that's exactly the idea mas i dont know how to do that.