When a user edits the value of a custom field business_sector__c on Opportunity using a standard page in Classic UI and clicks 'Save', I want to pop up a message reminding them that they need to review a field value on Opportunity Products. The popup should just have an 'OK' button that closes it.

What is the recommended approach for this?


  • The popup is required when the field value is changed. The value that it is changed to does not matter. – MikeA Nov 17 '16 at 10:45

if you are cool with replacing the edit button functionality to a custom vf pgae then I think we can achieve this.

In below example, i have a field leadSource on opportunity. if someone clicks edit on an opportunity and changes value of leadSource, a pop up will come step1: create a page which uses standardController=opportunity.


<apex:page standardcontroller="opportunity" extensions="testEditOppController" standardStylesheets="true" sidebar="true" showHeader="true">
    <apex:outputPanel id='testPanel'>
        function funcTest(varA){
                alert('LEAD SOURCE IS CHANGED');
    <apex:actionFunction name="doSave" rerender="testPanel" action="{!test}" oncomplete="funcTest('{!isChanged}'); "/>
    <apex:actionFunction name="redirectToDetailPage" action="{!redirectMethod}"/>
    <apex:outputPanel layout="block">
            <apex:pageBlockSection columns="2" title="Opportunity Information" collapsible="false">
                <apex:inputField value="{!Opportunity.LeadSource  }" style="height: 20px"/>
                <apex:inputField value="{!Opportunity.closeDate}" style="height: 20px"/>
                <div  style="text-align:center;">   
                    <apex:commandButton onclick="doSave();" 
                                        oncomplete="funcTest()" value="Save"/>


public class testEditOppController {
@TestVisible private final opportunity opp;
    public ApexPages.StandardController stdCon;
    public boolean isChanged{get;set;}
    public string callfunc{get;set;}
    public opportunity currentOpp{get;set;}

    public testEditOppController(ApexPages.StandardController stdCon){
        currentopp=[select leadSource from opportunity where id=:this.opp.id limit 1];
    public void test(){
        update this.opp;
    public pagereference redirectMethod(){
        PageReference pageRef=new PageReference('/' + this.opp.id);
        return pageRef;

On opportunity, for edit button, override with the visual force page you created above.

| improve this answer | |

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.