SAP Knowledge Base Article - Public

2562714 - Workflow Rule Not Working with "Value Before Object Change" Condition

Symptom

Your scheduled workflow rule is not being triggered even when the conditions are met.

Environment

SAP Cloud for Customer core applications

Reproducing the Issue

You created a workflow rule with at least one condition using the option "'Before Object Change". You selected the Timing = Scheduled.

  1. Go to the Administrator workcenter.
  2. Go to the Workflow Rules view.
  3. Click New.
  4. Add Description, Business Object.
  5. Set the Timing as "Scheduled" and click Next.
  6. In the "Step 2- Define Conditions" click on Add Group.
  7. Add one condition with "Value Before Object Change" toggle enabled.
  8. Go to next step and define Actions as per the business requirement.
  9. Go to next step Activate the workflow rule and Finish.

Now create a new record in the Business Object selected in the Workflow Rule such a way that the condition defined in the Workflow Rule matches with that of the Object.

RESULT: After waiting for the scheduled time, you see that the workflow rule is not triggered for the expected objects, even when the conditions are met.

Cause

In scheduled workflow rules, the condition of type "Before Object Change" is not supported.

The system checks the rule at the time of it being triggered. If the workflow rule is scheduled, that means that the change of the value already happened and at the time of the workflow execution, there is no longer a 'before' value (as the object change already happened previously).

The same is true for Workflow Rules with Timing equal to On Creation Only. When the object is created, there is no previous image that the Before Object Change can use, so this would also not work.

For workflow rules of type Scheduled, condition evaluation takes place twice -

  1. When the BO instance is change and the instance is evaluated for Scheduling.
  2. When the scheduled instance is executed. Since this is always in future, at this point, workflow does not have the before object image and in fact before object image is equal to current image of BO. In this case, this condition evaluation actually fails. 

Resolution

The Before Object Change scenario only works with the timing On Create or On Every Save. This is the system expected behavior.

Keywords

Scheduled Workflow, Workflow, Workflow Condition, Before Object Change, Scheduled , KBA , workflow , scheduled workflow , before object change , LOD-CRM-WKF , Workflow , Bug Filed

Product

SAP Cloud for Customer add-ins all versions ; SAP Cloud for Customer core applications all versions