function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Greg WilsonGreg Wilson 

Time-based workflows and rule criteria that are not met initially

Hello,

I'm having trouble getting time-based workflows and email alerts to operate the way I want.

 

Desired:

  • I want a time-based workflow on a custom child object that creates an email alert. 
  • It should send out a reminder email 30 days before the Due Date value on a custom child object, but only if the Status field on a custom parent object is "Approved". 
  • When the child record is created or edited, the Status field on the custom parent record is always "Draft", not "Approved". 
  • The Status field on the custom parent object is controlled by the usual approval processes in the platform, and that happens after edits to the child object have been completed.


Problem:

  • When the child record is created , the time-based workflow rules are not satisfied (the parent has Status "Draft") and the workflow fails.
  • When the parent Status is changed to "Approved" it doesn't trigger the time-based workflow rules on the child object.
  • The reminder email is never sent.
  • If I remove the criterion about Status, the workflow fires, but we risk sending inappropriate emails to external parties.


Not problems:

  • I can refer to the Status field of the parent in the workflow rule using a cross-object formula on the child object.
  • Time-based workflows in general work fine in my org.
  • The workflows are activated.


Help:

What can you suggest? Someone must have faced this situation before me, and found a good solution.

 

Thanks in advance!

 

Greg.

Navatar_DbSupNavatar_DbSup

Hi,

 

Since, you are working on two different types of object. So you have to first off all use the cross object workflow to update the parent object field value with status=’Approval’ whenever a new child record is created. But for that there must be master details relationship between these two objects.  Once you will be able to do then only you can achieve this through workflow, else you have to use Apex.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

Greg WilsonGreg Wilson

Ankit,

 

Thanks for responding so quickly.

 

I must not have been totally clear.  Setting 'Approved' on the parent record is the result of a completely separate business process.   It is separate from creation or editing of the child records.  There's already a master-detail relationship there.

 

It looks like I'll have to use Apex to get this done.

 

Thank you,

 

Greg.