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
SquashcookieSquashcookie 

Workflow to trigger on Parent's value

Hi guys

 

I'm wanting to trigger a time based workflow rule based on the criteria of the parent object.

Is this possible?

 

ie. ObjectA is parent to ObjectB

I want a time based email alert to be sent to ObjectB if the Status of ObjectA isn't 'CLOSED'.

 

From my understanding, Workflow Rules are triggered when an object is edited, so to send an email to ObjectB requires a field on ObjectB to be edited.  Seeing as the criteria points to ObjectB's parent, changing the Status at ObjectA won't trigger the Workflow Rule for its ObjectB child record(s).

 

Is this possible without delving into Apex code?

 

thanks

 

atallatall

As per your message, I've understood that Object A has the picklist field with values "closed", "not closed", Object B has a lookup relationship field which is the child of Object A.

 

if it is true then the work flow has to be executed onto object B when the object A field value has changed to "not closed"

 

if the above conditions are true, please select "object B" when you start writing the workflow rule

 

next step: Mention the rule name

 

next step:Mention Evaluation Criteria

 

next step: Chnage the Rule criteria to "formula" by changiong the rule criteria to "formula evaluates to true"

 

Paste the code as AND( ISPICKVAL(Object_A__r.Status_of_Object_A__c, "Not Closed"))

 

then select email template, give the time based workflow

 

Please let me know if this works for you.

 

 

 

 

SquashcookieSquashcookie

Hi Atall,

 

Thanks for the response.

From your response, you understand exactly what I'm after.

 

However, I'm led to believe the workflow rule won't trigger because a change to ObjectA wont trigger a workflow related to ObjectB.

 

ie.

 

At time t=1

Object_A__r.Status_of_Object_A__c = "Not Closed"

Object_B is created.

Because the status of ObjectA is "Not Closed", the workflow rule is activated and a time based email alert is scheduled.

 

at time t=2

Object_A__r.Status_of_Object_A__c is changed to "Closed"

ObjectB doesn't change

Because the change to ObjectA doesn't trigger the re-evaluation of the Workflow rule, wouldn't this still result in the email alert being sent?

 

Or with Time Dependant Workflow Actions, does the Rule Criteria get re-evaluted even when no changes have been made on ObjectB?

ie.  If a want an email sent 1 week before ObjectB__r.Expiry_Date__c, will the algorithm check ObjectA__r.Status_of_Object_A__c before sending the email?

atallatall

Here I've used the lookup relationship field which relates one object to another object

 

as per the expression I've used, Whenever Object A field value equals "Not Closed", email will be sent and Object A field value equals "Closed", workflow wont be triggered. If you want to trigger the workflow rule for the value "closed", we can write another workflow rule within the same workflow which we have used right now.

 

Time dependent workflow actions are purely dependent on the work-flow rule, So once rule starts executing time trigger will be triggered. i.e., ObjectB__r.Expiry_Date__c is on when ObjectA__r.Status_of_Object_A__c = "Not Changed" else it will be off.