0

Is there any way to identify when lead conversion has triggered a process builder workflow and prevent it from doing so?

For example, if I have a PBR functioning when a task is created, I don't want it to run if that task is created during lead conversion.

EDIT:

More context on what's happening... I have a PBR that logs the last activity date on either the lead or contact record. However, I get the following error when the activity is trying to be created during the lead conversion process:

Error Occurred: The flow tried to update these records: 0031N00001M6aLwQAJ. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . For details, see API Exceptions.---The flow tried to update these records: 0031N00001M6aLwQAJ. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . For details, see API Exceptions.---The flow tried to update these records: 0031N00001M6aLwQAJ. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . For details, see API Exceptions.---The flow tried to update these records: 0031N00001M6aLwQAJ. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . For details, see API Exceptions.---The flow tried to update these records: 0031N00001M6aLwQAJ. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . For details, see API Exceptions.---The flow tried to update these records: 0031N00001M6aLwQAJ. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . For details, see API Exceptions.---The flow tried to update these records: 0031N00001M6aLwQAJ. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . For details, see API Exceptions.---The flow tried to update these records: 0031N00001M6aLwQAJ. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . For details, see API Exceptions.---The flow tried to update these records: 0031N00001M6aLwQAJ. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . For details, see API Exceptions.---The flow tried to update these records: 0031N00001M6aLwQAJ. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . For details, see API Exceptions.---The flow tried to update these records: 0031N00001M6aLwQAJ. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . For details, see API Exceptions.---The flow tried to update these records: 0031N00001M6aLwQAJ. This error occurred: ALL_OR_NONE_OPERATION_ROLLED_BACK: . For details, see API Exceptions.---The flow tried to update these records: null. This error occurred: DUPLICATE_VALUE: Maximum number of duplicate updates in one batch (12 allowed). Attempt to update Id more than once in this Api call: 0031N00001M6aLw. For details, see API Exceptions.---The flow tried to update these records: null. This error occurred: DUPLICATE_VALUE: Maximum number of duplicate updates in one batch (12 allowed). Attempt to update Id more than once in this Api call: 0031N00001M6aLw. For details, see API Exceptions.

Here's the relevant parts of the PBR:

enter image description here

enter image description here

  • Need more info here... what causes a task to be created during Lead conversion? – Charles T Mar 8 '18 at 1:32
  • @CharlesT added more info to the post – Matt Mar 8 '18 at 2:50
  • Thanks. Why is an activity being generated during lead conversion though? That part I don't get. – Charles T Mar 8 '18 at 12:52
  • On the lead conversion page it includes a section on task information by default. Even if you don't input anything, it still triggers the PBR and fails for some reason – Matt Mar 8 '18 at 16:41
  • Oh I see, so it's moving Tasks from the Leads to the newly created records. Maybe you could check (via 3 character prefix of the ID) if the WhoId of the Task is changing from a Lead to no longer a Lead? – Charles T Mar 8 '18 at 19:03
2

There's no way to know a Task is coming from a lead conversion unless your conversion process sets a field value in the task record to flag it as such.

With Contact and Opp, you can see if they originated from a lead conversion by looking at the ConvertedContactId and ConvertedOpportunityId the Lead object, but you would need a visual flow or Apex trigger to do this query.

| improve this answer | |
-1

There is one workaround i have found out. The error occurs because there are too many tasks. All of the task are trying to update the object. If you convert the lead, all tasks are updated because of the AccountId Field. Is the Task related to a lead it is null.

So you have add the follwing criteria:

"accountid ischanged is false"

So the workflow is not fired when you convert the lead.

| improve this answer | |
  • Hi joe, welcome! This has been flagged as low quality, can you expand on it a little? – Matt Lacey Feb 27 '19 at 0:39
  • Hi Matt, i have tried to make my post more clear – joeW Feb 27 '19 at 7:43

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.