Opening a visualforce page from normal apex class or from Trigger please help me
HI Everyone,
I wish to display a message to my users like "You are not allowed to edit the Close Date" in opportunity object while updating an opportunity record useing standard UI (not Visualforce page). So I want to open a visualforce page from trigger or normal apex class.
I think you can achieve this with the help of validation rule and check for whether the close date has been changed or not and depending on that display the message to the users and this message will be displayed on standard UI only.
BSridhar is right: If your business rules are pretty simple then you can achieve it using validation rules :something like below.....if business rules are complex then use trigger.
Description:
Ensures that only the record owner can make changes to a field called closeddate.
You need a trigger with .adderror method
refer these pages: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_context_variables.htm
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_sobject.htm
Hi,
I think you can achieve this with the help of validation rule and check for whether the close date has been changed or not and depending on that display the message to the users and this message will be displayed on standard UI only.
Regards,
Sridhar Bonagiri
BSridhar is right: If your business rules are pretty simple then you can achieve it using validation rules :something like below.....if business rules are complex then use trigger.