SAP Knowledge Base Article - Public

2745938 - Cancel Action Defined on Workflow Rule Is Not Triggered on the Creation Time

Symptom

Cancel action defined on workflow rule is not triggered on the creation time.

Environment

SAP Cloud for Customer

Reproducing the Issue

To reproduce the issue, the user should define a workflow rule according to the following steps (Visit is used as a Business Object, however it can be applied to other Business Objects):

  1. Go to the Administrator work center.
  2. Go to the Workflow Rules work view.
  3. Click on New button to create a workflow rule.
  4. On step 1 Enter Basic Data, fill the description field, select the Business Object Visit and select On Create Only on Timing field.
  5. On step 2 Define Conditions, click on Add Group and set Field as Start Date Time, set Compare Operator as Less than, select Field on With and Created On option.
  6. Add a new condition clicking on Add Group and set Field as Start Date Time, set Compare Operator as Less than, select Field on With and Created On Date Time option.
  7. On step 3 Define Actions, set Rule Type as Action, and define the Select Action as Cancel.
  8. On step 4 Review, click on Activate and Finish.

After the workflow is defined, the user will create a Visit in which the Status will be set as Cancel when the Start Date Time is Less than Created on Date Time.

  1. Go to the Visits work center.
  2. Go to the Visits work view.
  3. Click on New button to create the visit.
  4. Fill the mandatory fields.
  5. Set the Start Date/Time field before the current Date/Time.
  6. Click on Save and Open.

Result: The visit's status is not changed to Cancel, therefore, the workflow rule was not triggered.

Cause

The visit status is not changed because the system Administration Data - as Creation Date time, Created By, Created On - will be fulfilled after the visit creation and at this moment, the workflow was triggered and the condition was not sufficed.

Resolution

To change the status according to the conditions defined on the workflow rule, the timing must be set as scheduled to be executed after a few minutes as described on the following steps:

  1. Go to the Administrator work center.
  2. Go to the Workflow Rules work view.
  3. Click on New button to create a workflow rule.
  4. On step 1 Enter Basic Data, fill the description field, select the Business Object Visit and select Schedule on Timing field.
  5. Under Event field, select Created On, define Relative Time as After, Time Offset few minutes.
  6. On step 2 Define Conditions, click on Add Group and set Field as Start Date Time, set Compare Operator as Less than, select Field on With and Created On option.
  7. Add a new condition clicking on Add Group and set Field as Start Date Time, set Compare Operator as Less than, select Field on With and Created On Date Time option.
  8. On step 3 Define Actions, set Rule Type as Action, and define the Select Action as Cancel.
  9. On step 4 Review, click on Activate and Finish.

The workflow rule will be executed few minutes after the Visit creation and the status will be changed to Cancel in case the Start Date Time is less than Created On time.

See Also

SAP Admin Guide - Workflows

Keywords

Workflow, Creation Timing, Action , KBA , LOD-CRM-WKF , Workflow , How To

Product

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