0

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.

4
  • this is possible after save using inline vf page. Im not sure abt before save. 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... Nov 8, 2016 at 12:22
  • i dont have code for before save. Nov 8, 2016 at 12:24
  • @Shravan Boddula You can share any other sample code where you are displaying warning message. Nov 8, 2016 at 12:43

1 Answer 1

0

Here is vf page

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

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.

2
  • 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. Nov 8, 2016 at 13:16
  • check in the page layout level. might be readonly access on page layout level Nov 8, 2016 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.