You need to sign in to do that
Don't have an account?
Ab
When user clicks on button, display a message and block the execution of apex code
Hello,
I have a button like below on Opportunity object
If the Created date of opportunity in less than jan 2015, i want to display a message to user to say that "opp is too old cant convert" else the apex code is executed normally.
How can i implement the code ?
Thank you for suggestion !
I have a button like below on Opportunity object
<apex:page standardController="Opportunity" extensions="VFC009_CreateContract" lightningStyleSheets="true" docType="html-5.0" > <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <head> <apex:slds /> </head> <body> </body> </html> </apex:page>
public class VFC009_CreateContract { public VFC009_CreateContract(ApexPages.StandardController stdController){ currentOpp = (Opportunity)stdController.getRecord(); initPage(); } }
If the Created date of opportunity in less than jan 2015, i want to display a message to user to say that "opp is too old cant convert" else the apex code is executed normally.
How can i implement the code ?
Thank you for suggestion !
Best Answer chosen by Ab
Tad Aalgaard 3
Add this to your visualforce page to display the error messages.
Add this to your Apex code to create a conditional error message.