Suggestion about workarounds to create CTA by rule with a specific Due date

Related products: None

Hi Guys,





I'm looking for a way to create CTAs with a specific Due Date by the rules.


I've posted before replying about some other guy suggestion about it (3years ago).





But I didn't have any answer. I would like to know if someone has some workaround to do this:


We try to create an alternative with Process Builder, but it doesn't work I don't know why (maybe because has some Gainsight apex that updates de Due date in the CTA creation).





If someone can check our logic of Process Builder and give some advice will be great as well.





My intention is:


When a CTA is created I want to update the Original Due and Due date to the last day of month from Today()+7





So we did in Salesforce Process Builder the following steps.





1. [JBCXM__CTA__c].Name contains (uncovered customer) - Sample of some CTA.


2. [JBCXM__CTA__c].JBCXM__Source__c = Rules


3. [JBCXM__CTA__c].JBCXM__Reason__c= a0U1a00000G3APaEAN - Our Reason ID


4. [JBCXM__CTA__c].JBCXM__OriginalDueDate__c is null = false





So, basically get a specific reason with a specific name that was created by rules and has the OriginalDueDate.





After that as immediate action:


Update Due Date and Original Due date field with this formula:


DATE(


IF(MONTH( TODAY()+7 ) = 12, YEAR( TODAY()+7 )+1, YEAR( TODAY()+7 )),


IF(MONTH( TODAY()+7 ) = 12, MONTH( TODAY()+7 ) - 11, MONTH( TODAY()+7 )+1),


1) -1





So looks like a simples process builder but just doesn't work.





I'm afraid if someone understands why.





Anyway, thanks for help.
Hey Olavo - 





Are you getting an error from SFDC when this process is triggered?  If not, and the due date is not getting updated, you are likely not triggering the process.  What does the update step look like?  Thanks!





Tim
Hi Tim,





I didn't get an error.


Is just not getting updated and my immediate action as I said is just a formula.








Thanks man!
Interesting.  It sounds like you are not triggering the process.  For the object selection, do you have any criteria or is it upon creation and/or modification?  Usually, the first step to troubleshooting these PBs is to make sure it fires and look at the resulting error.
It is not interesting it sucks =/


You are right the process trigger looks that is not working. But I tested many ways.


And if I change the Source to be Manual instead of Rules. It works (manually)





If I remove the CTA source filter it works manually as well. But still doesn't work by rules.





The problem is the Gainsight Rule, What I think and I expect that some engineer here say is if there is some hidden APEX that changes the Due Date after any update on the creation of the CTA.





What should I do if it is caused by an Apex?


Thanks,
Hi,


We first create CTA and then apply playbook while creating CTAs with playbook so if any of playbook tasks due date is resolved to a date greater than CTA due date then CTA due date will be updated max task due date. So, you may want to update your process to consider CTA due date update and also make sure that you set Recursion to off for this action.
Hi Srinivasa,





Thanks for your reply.


The CTA has a playbook applied but the maximum date is Assignee +1


and by the formula in the process builder the CTA due date will take a minimum of 7 days.


So, I understand that the Task due date won't affect the Process Builder.





And yes I checked the Recurision in the tests but doesn't work in the rule creation.


Probably is some background automation that we can't see.
What I was trying to say is, we first Insert CTAs and then update CTA due date again when tasks are created using playbook ( I think this the one you are referring to as background automation) . I was advising you to use "when a record is created or edited" option instead of "only when a record is created" to initiate the process.
I understood your point. I made the change to modify "when a record is created or edited".


And it didn't work by rule 😕 . If I try manually even applying the playbook it works. There is still something else.


With this change, I added one more criterion in my filter that is when you have the specific playbook to trigger.







Hi Srinivasa Pulagam,





Do you have some other advise of what could be to active this??





Thanks for your help.




Hi,





I will try similar workflow in my org and see what is the issue. I will update my findings soon.




Hi Srinivasa,





Thanks, I really appreciate your effort for it.




Hi Olavo,





We tried few processes with Salesforce process builder to update CTA due date, haven't faced any issues. Probably issue is with process criteria or something else. Can you please check with due date set to a static value of far future date in your process action and see you are not facing this issue only for Rules based CTAs.




Hi Srinivasa,











Strange, but if it works for you and not for me I will record a video and open a ticket.





I checked the process builder criteria, and the same criteria on manually work the issue are the Rules CTAs.





So thanks for your effort on this, I really appreciate and now I know that is possible. We just need to understand the bug cause that I will check with support.





Bests,