Skip to main content
Hi all,

 

I need your help regarding a requirement on Tasks.

 

The need is as follows :

 

When a Task with a specific Type is completed, it has to create another reminder Task EXCEPT if the associated Person Account (in whatid) has the checkbox "No reminder" checked.

 

In standard workflows it is not possible to query on whatid fields. But standard workflows are more maintenable as a functional admin can create ones without coding, he can change the criteria, the Taks type etc.

 

So what we did is create a standard WF on Task with

 

condition : status = 'Completed'

 

evaluation criteria : when a record is created

 

action : creates a Task with type = "Call" and objet = "Reminder"

 

and then a trigger beforeinsert which checks a technical field "To delete" in the Task  if whatid has "No reminder" checked. Then an afterinsert trigger calling a Future method to delete the reminder Task if the "To delete" is set to true.

 

But even if "No reminder" is checked on whatid, once a Task is completed on the whatid, it creates the reminder Task anyway and we have to refresh the page to make it disappear.

 

My question here is : do you guys know another way to avoid this manual refresh? or the workaround is to create the automatic reminder task via an Apex trigger? (so without any standard WF=>lack of maintenability)

 

Thank you,

 

Anne
1 respuesta
  1. 28 jul 2014, 17:24
    Hello Anne,

     

    Thank you for posting to Succes Community.  For code related questions may I also suggest posting your question to our Developer Community at developer.force.com.
0/9000