Skip to main content
Tweeted twitter.com/#!/StackSalesforce/status/238516402280099840

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.

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

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

I have a custom field called Pipeline which 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 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.

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

  1. Workflow rule that nulls Pipeline. AddError in before 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.

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.

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

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

Source Link
Eric Nelson
  • 719
  • 6
  • 18

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

I have a custom field called Pipeline which 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 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.

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

  1. Workflow rule that nulls Pipeline. AddError in before 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.