[SalesForce] Generating notification for user to confirm that a field has the correct value

I have a custom field called Pipeline which is a required Yes/No picklist that defaults to No. When the user makes some specific changes to the record, and Pipeline=No, I would like them to confirm that Pipeline should remain No. I have tried to implement this in several ways:

1) Validation rule making Pipeline required. Before update trigger that nulls out Pipeline when those specific changes have been made to the record.

Result: this gives the user a notification, but then when they click save, the trigger runs again. and again. and again. Because the changes gets rolled back when validation fails, it always looks to the trigger like fields have been modified on the record.

2) Like 1 but with a static variable in the trigger to tell the trigger it as already run once.

Result: same thing. Apparently the static variable gets lost as soon as the validation fails.

3) Workflow rule that nulls Pipeline. AddError in before update trigger when Pipeline is null.

Result: About the same as the others. Workflow still runs every time because the record was never successfully updated, the fields appear to have been modified every time it runs.

Been going through the order of operations and trying to figure out some way to get this to work. I am looking for a solution without a VF component, but I am not sure there is one.

Best Answer

One way that I've handled this before is to add a checkbox to the record of 'Confirm'. Then when a user saves the record, a validation rule checks the Yes/No value and looks at the confirm checkbox. If the checkbox is false, the validation rule throws an error and the error message asks them to tick the checkbox and resubmit.

If the confirmation is a single shot deal and the value needs to be reconfirmed every time, you can add a workflow rule that clears the checkbox when the record is edited or updated.

Related Topic