SAP Knowledge Base Article - Public

3053335 - Workflow not Triggered by Custom Code Logic

Symptom

You have scheduled a Workflow to trigger based on conditions. These conditions are met in custom code logic in your Add-On Solution but the Workflow is not triggered as expected.

Environment

  • SAP Cloud Applications Studio
  • SAP Cloud for Customer

Reproducing the Issue

Prerequisites:

  • You have a Custom/Extension Business Object in your Add-On Solution.
  • You have a BeforeSave script for your Business Object (BO).
  • You are meeting the conditions in code logic during execution of the BeforeSave script.

Cause

Workflow scheduling/execution is called before the execution of the BeforeSave script. This behavior means that any change made in the BeforeSave is not relevant for Workflow conditions.

Resolution

  1. If the BeforeSave change is made to the same BO, you can try to set the Workflow to scheduled after [unit of time] .
  2. If the BeforeSave change is made to a second BO (and the Workflow is for this second BO), you need to move the logic to the AfterModify script.

Keywords

PDI, SDK, BeforeSave, AfterModify, script, ABSL, Action , KBA , AP-RC-BDS-SCR , ByDesign Studio Scripting (ABSL) , LOD-CRM-WKF , Workflow , Problem

Product

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