Symptom
You want to create leads via SDK and you may experience below scenarios:
- Lead creation is taking too long for processing
- Lead creation is getting into endless loops
- Lead creation ends up in some errors
Environment
SAP Cloud Application Studio
SAP Business ByDesign
SAP Cloud for Customer
Reproducing the Issue
You will experience this issue if you have used the LeanLead.Create in the PDI code while running a MDRO from UI(depends on case to case) or via intergration.
Cause
This issue happens if LeanLead Business Object is modified within the Lead BeforeSave event in scripting.
Since both Business Objects have the same persistency, any modification of the LeanLead Business Object triggers the BeforeSave of Business Object Lead, thereby resulting in an infinite loop/error.
Resolution
It is recommended to shift all logic dependent on LeanLead to the Lead Business Object, as this would ensure the consistency of the solution as well as prevent the infinite loop/error/time lag in the future.
Keywords
PDI code is taking too long while running MDRO MDRO for Lead creation is slow infinite loop while replicating lead , KBA , AP-RC-BDS-SCR , ByDesign Studio Scripting (ABSL) , LOD-CRM-LM , Lead Management , Problem