On Opportunity Object,There are 2 fields Stage and Probability which are linked to each other.As we changed the stage,it changes the probability value. Users having edit permission on Probability field can add manual value in Probability field but if we are adding manual value instead of default one, is there any way to display a warning message on screen before?

The warning message is only for users convinence as they are adding their own value instead of default one.

  • this is possible after save using inline vf page. Im not sure abt before save.
    – S B
    Commented Nov 8, 2016 at 11:53
  • @Shravan Boddula Do you have a code sample to display warning message? I have to show warning when user change the field value before he saves the record...
    – SFDCDJ
    Commented Nov 8, 2016 at 12:22
  • i dont have code for before save.
    – S B
    Commented Nov 8, 2016 at 12:24
  • @Shravan Boddula You can share any other sample code where you are displaying warning message.
    – SFDCDJ
    Commented Nov 8, 2016 at 12:43

1 Answer 1


Here is vf page

<apex:page standardController="Opportunity" rendered="{!Opportunity.StageName == 'Proposal'}">
 <script type="text/javascript">
  { window.alert("Your message here"); }

Go to opportunity and edit opportunity page layout. Drag this new visualforce page on page layout. Edit the visualforce page properties and set Height as 0 pixel. (We don't need to show this page to users.) Save the page layout.

  • Thanks for the code sample.Just one question.On Profile level we have given read only access to probability field to certain users if I create a separate permission set where for Opportunity object if I Provide edit access to 'Probability' field would it allow users to edit probability field based on its permission set.I tried to create permission set where i have given edit access to 'Probability' field but when i create/edit record,Probability field still display as read only even after assigning permission to the user.Not sure what I am missing in permission set.
    – SFDCDJ
    Commented Nov 8, 2016 at 13:16
  • check in the page layout level. might be readonly access on page layout level
    – S B
    Commented Nov 8, 2016 at 13:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .