function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDC RocksSFDC Rocks 

how to display a warning dialog box when a field is changed

For a text field on one of my screens, I want to display a warning message anytime the user changes the field's value so that they are definitely sensitive to the impact of changing the value.

Is there an easy way to add a warning dialog box as part of a custom field's on-change event for a screen created using Builder (setup UI)?
This is exactly what I was searching for in here. :smileyhappy: I would love the answer to this as well.
Can't be done on an edit page, since you cannot include script.  You could, of course, accomplish this with a Visualforce page.  There might be other ways to get to this kind of functionality, such as including a check box to confirm that they want to change the value, and then a validation that checked for this confirmation.  (I actually really don't like that option, but you could do it with Builder alone - take it for what it is worth)

I am considering the following:

  1. Build a trigger or internal callout from the given screen to apex code.
  2. This apex code checks for conditions to generate a message and cause an error
  3. Error is generated on page to say "please confirm on left" 
  4. Message is sent to a VF page component in the left margin with message and links to say "Yes or No"
  5. when they click Yes or no, save the record without error

some things I am not sure are possible:

  • inline VF pages are allowed in left margin 
  • inline VF margin component refreshes to show message
  • Confirmation links in margin component know what action to take
  • Confirmation links know how to pass the override so the "please confirm on left" error is not caused again.
  • When action is applied the main page moves to the correct next screen


All that to cause silly dialog boxes on a website!