I have a requirement where if a Case is saved without a value in a field, the page needs to prompt the user if they are sure they want to save. This would need to be on a standard page layout.

I was thinking of using a trigger, but there is no actual way to get the user to interact with the trigger.

Javascript prompting can't be used because it's not a visual force page.

Validation rules can't be used, because it prevents the saving of the record.

Any advice would be great.

  • 1
    If you want to accomplish this, you need to replace the relevant Case actions (New/Edit) with VF. I'm pretty sure there is no way around that. – Adrian Larson Jun 10 '15 at 19:51

You can add a checkbox ('No Value in Field' in your case) and apply a validation rule that validates the box is checked and if not, throws an error asking them to confirm by checking the box. The downside to this is that some users just tick the box every time they save as they realize this will avoid the error. I usually add a workflow to clear the checkbox upon completed save, so that the user will have to reconfirm


Another approach is probably you need to go to a custom UI

There is an idea about warning messages on record save.Please vote for it

| improve this answer | |
  • Hi Sf.dev, I know I might be putting a silly question here but just curios. Can't we insert the Visualforce component and use just jquery to get the SAVE button, write code for confirmation and complete this requirement. I believe, based on below we can still run javascript on standard page layout .salesforce.stackexchange.com/questions/38918/… Apologies if I asked a stupid question.. – amidstCloud Jun 10 '15 at 20:18
  • Thanks @sf.dev , I'm letting my team know about this. Also that link is 7 years old. I highly doubt salesforce monitors that – TemporaryFix Jun 10 '15 at 20:33
  • On the contrary - Shannon Hale, the relevant PM, posted an update a couple of years ago. We do monitor ideas, particularly as they continue to pick up votes. – metadaddy Jun 10 '15 at 23:07
  • @amidstCloud I wouldn't give up on old Ideas in the Success Community, as a former Product Manager, we pay attention to the ones getting votes. – Bobby White Jun 19 '15 at 14:09

You want a Validation Rule, however, there is no mechanism to override in the Standard Platform. The UX describe by SF.DEV would prevent saving and would require an additional field to be persisted.

Alternatively, you could create a "Wizard" using the Visual Workflow "Interview". Visual Workflow Documentation

You would collect the basic information in one or more screens. On those screens, you can use validation for fields that are always required. For fields that are "recommended" but may be overridden, you need a Decision step and then you can show a Confirmation screen before you save the record. If the user doesn't confirm the save (without value), you can send them back to the prior screen to update.

| improve this answer | |

An alternative approach to this is the soft alerts solution

Essentially, rather than prompting the user: 'are they sure they want to save', you let the save go through but display via an Alerts__c formula text field using IMAGE() - a nice yellow flag and the message (at the top of the page layout) -

"Case saved without a 'foo'. Edit the case if 'foo' should be present."

This of course may not be relevant for all use cases but it avoids the VF or VF+jQuery path - 100% clicks, not code.

| 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.