Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Triggering workflows on field changes to a field a user does not have access to
#1
This one is quite complicated and took me a while to figure out. This explanation is hypothetical but realistic:

Let's say I create a checkbox on salesorders called 'check A'. I have user U that has profile P. Profile P does not have access to check A, so subsequently user U does not have access to check A. Now user U alters some ticket that is related to a salesorder. I, the admin, have a workflow installed on tickets that sets check A to 'true' when certain conditions on the ticket are met and triggers the workflows on the related record (so, the salesorder). Subsequently, I have a workflow on salesorders that monitors check A. When check A is changed to 'true', I want to send an e-mail. So basically, user U can do some work on a ticket that triggers a chain of events that in the end, sends an e-mail from a salesorder.

The above will only work when I give user U access to check A. I can make actions that user U does on a ticket alter check A, but the second part of the chain, monitoring whether check A has changed to true, requires access to check A I presume, which the workflow does not get (I think) since it is executed by user U, who is not allowed to access check A.

This is not a major problem, but does require me to present user U with fields they don't need and therefor confuse them, just to make my workflow work.
Reply
#2
are you sure about this? can you share some screenshots? do you have marked the option "trigger workflows on related update"?
Joe
TSolucio
Reply
#3
Yes I am sure, I spent almost an hour trying various combinations and checking my configuration. In the end, starting the workflow chain would not place an entry for the task ID in the workflow task queue table when profile P did not have access to check A, and as soon as I gave profile P access to check A, the task ID appeared in the table and the e-mail was sent. Also, performing the same operation as an admin also triggered the e-mail.
Reply
#4
can you share some screenshots of the configurations? I suspect it is because the conditions cannot be evaluated as we did a lot of work with the from_wf variable to make sure this was supported.
Joe
TSolucio
Reply
#5
Try this change and let me know how it goes so I can put it into the master branch

Code:
diff --git a/modules/com_vtiger_workflow/tasks/VTUpdateFieldsTask.inc b/modules/com_vtiger_workflow/tasks/VTUpdateFieldsTask.inc
index 0a0e6ac1d..76b287484 100644
--- a/modules/com_vtiger_workflow/tasks/VTUpdateFieldsTask.inc
+++ b/modules/com_vtiger_workflow/tasks/VTUpdateFieldsTask.inc
@@ -116,6 +116,7 @@ class VTUpdateFieldsTask extends VTTask {
                       $focus->saveentity($moduleName);
                       if (count($relmodule)>0 && $relId!='' && $relId!=0) {
                               foreach ($relmodule as $mod) {
+                                       $from_wf = true;
                                       $focusrel[$mod]->column_fields = DataTransform::sanitizeRetrieveEntityInfo($focusrel[$mod]->column_fields, $handlerMetarel[$mod]);
                                       if ($this->launchrelwf) {
                                               $focusrel[$mod]->save($mod);
Joe
TSolucio
Reply
#6
Will do, but I have to wait until we are outside office hours
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)