0

I'm working in process builder and am running into an issue.

My criteria is only on create, not on create & edit:

  1. Choose the Contact Object
  2. Criteria is met (Field A = true, Field B = today)
  3. Create a task record with standard task values filled in

I am trying to make it so that only 1 task is created per user in Salesforce. With my current process builder, multiple tasks are being created. Is there any way to block multiple tasks from being created in process builder?

  • Can you clarify how, if your process runs only on creation, more than one Task is being created for the same record? – David Reed Aug 21 '18 at 15:45
  • You said 1 task is created per user in Salesforce if user create three record and all record meets the criteria at the time you want only one task not three task? – Chandra Kiran Aug 21 '18 at 15:58
  • @ChandraKiran Correct, I would only want one task created – Jord Aug 21 '18 at 16:45
  • @DavidReed Multiple tasks are created since the criteria is met. I would only like one task created per user. – Jord Aug 21 '18 at 16:46
  • I suspect there's more to the requirements here - for example, what do you want to happen when that one task is completed? I think it would be helpful if you can flesh out your question with a very concrete example. – David Reed Aug 21 '18 at 16:48
1

I am expecting that you are creating a task for record owner

So first, You can create a checkbox field on User Object like (Is_Task_Created__c)

In the process builder add one more criteria like Contact.Owner.Is_Task_Created__c == false

After that, create a trigger on task object and call a future method that will update the Is_Task_Created__c flag on user.

we are calling future method because in same transaction it will give mix dml error.

Don't forget to uncheck the flag (Is_Task_Created__c) when user closed the task. you can do this in task trigger.

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.