Hello Experts.
I've met non trivial problem that I cannot solve (find solution for few days). The basis of problem that I have 2 processes started 1 by 1 one using WF:
1st process is dialog and bound with logged user. For this process stands user decision in WF, whenever user make a decision in WebUI there is possibility to enter decision note text not and this note will be transfered into the order header. The main logic is :
- Starting CRM_ORDER_ENQUEUE
- Then text wrote to the document
- Then CRM_ORDER_SAVE is called
- Then CRM_ORDER_INITIALIZE
- Then commit and CRM_ORDER_DEQUEUE
Right after that (when dialog process is finished) a new process called in background to update status of document. This process is #2 and called from WF-BATCH user. The simillar approach is used here with CRM_ORDER* FM, but when CRM_ORDER_ENQUEUE called I recieve an exception that "Document is beign distributed. Changes not allowed", to solve this problem I've tried many cases like:
A) Calling do cycle with large ammount of DOs (wait untill and so on) untill CRM_ORDER_ENQUEUE will lock order successfully->then if it is dequeue if lock was ok, BUT it does not work. It always returning the same error EVEN if i check order within CRMD_ORDER and see that order is distrebuted to R/3 sucessfully...
The only way that was working for now is put infinit cycle in #2 process -> then go to SM50 -> start debug AND then process it manually ... then everything is working, but this is kinda stupid...beacuse my mentioned approach A) should do the same, but not...
Does anyone have met this problem? or have ideas what is going on?
PS: Answering on putting 2 process into 1 dialog. It is not a way to go for me, so I should use exactly the same architecture as I described.
Thanks!
Best Regards,
Yury