[Vtigercrm-developers] Run workflow after revise
omri yona
omri.yona at gmail.com
Wed Nov 11 10:47:51 GMT 2020
Hello all,
I found a wired case that I try to understand if its a Bug or i did
something Wrong. Sorry that Its long but I will try to explain my case.
I have two workflows is my custom module
1. If I don't have organization to my custom module - To run a invoke
function to find my Organization and revise the record (vtws_revise) with
new Organization (and clear X field as will explain below)
The workflow set to run if organization is empty
2. If i have an Organization or its replace I need to update X field data
this workflow set to run if:
organization if not empty and
X field is empty Or organization is change
So in my case the second workflow needs to run after the first one
(organization is changed).
When I Update/Clear Organization in The record in GUI everything run as I
expect But...
If I have a record with no Organization the first workflow trigger and if
its found an organization its revise the record and then the workflow run
again and entering to Loop (like i don't have Organization even that I
revise the organization).
try to change $VTIGER_BULK_SAVE_MODE = true but than second workflow didn't
run.
I had a workaround code in my first workflow to check if I have
Organization in DB and stop the run if Yes (I found that in DB i get value
to organization but not in entityData)
But then the agin second workflow didn't run - even that my Organization is
full and X field is Empty (done it in my revise record) - If i will had any
update in gui to the record its will run OK.
So I understand that after revise record the wotkflow trigger with the Old
entityData and not the new one.
I had in my first workflow call the second workflow after add set to the
entityData and its work But i don't think it Ok that revise record don't
trigger the workflow with the new data
Thank you for all you support,
Omri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20201111/6d855e9b/attachment-0001.html>
More information about the vtigercrm-developers
mailing list