0

Users are trying to convert leads and are receiving an error that they cannot convert the lead due to a pending Time-Based Workflow Rule.

I want to create an APEX Trigger that turns off the Workflow Rules prior to the lead executing the lead conversion. That way we will have a successful conversion.

Does Salesforce offer a BEFORE lead conversion class where I can implement some sort of update to the lead that will shut off time-based workflows prior to the standard conversion process?

IF not, what other alternatives are available?

2

You can't remove queued time-based workflows from a trigger. However, best way to address this issue is to invalidate the workflow rule criteria:

Modify your workflow rules with Time-Based Triggers to never apply to Leads that will be Converted. You can add a checkbox field that users will check when they want to Convert that will “disengage” the workflow rule criteria.

Alternatively, you can automate toggling this checkbox by overriding the convert button through a VF page, as described here info

1
  • 2
    Welcome to Salesforce Stack Exchange (SFSE)! Thanks for contributing.
    – Moonpie
    Nov 11 '21 at 20:55

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.