Page 1 of 1

Querying the STEPS in a trigger

Posted: Tue May 30, 2017 10:28 am
by Throwaway
What would be the easiest way to query STEPS in a trigger or have a button redirect to Dynaform (assuming it is in the same task)? I am aware that I could use the below method, but I would like to just have it directly go to the Dynaform without having to worry about the placement of the step being added or changed as the user would not use the STEPS menu. Maybe by somehow pulling the DOM elements and directing button_1 to dynaform_test?
Code: Select all
$("#moreInfo").find("button").click(function(){
   $("form").saveForm();
   //redirect to a DynaForm which is the 3rd step in the current task
   location="../cases/cases_Step?TYPE=DYNAFORM&UID=XXXXXXXXXXXXXXXXXXXX&POSITION=3&ACTION=EDIT";
});

Re: Querying the STEPS in a trigger

Posted: Wed May 31, 2017 3:15 am
by mishika
Hello,

To redirect to a Dynaform without knowing its position in the task, you can use the following ProcessMaker function in a trigger:
Code: Select all
PMFRedirectToStep(@@APPLICATION, @%INDEX, 'DYNAFORM', '60422430056a69386a2a885087313352');
@%INDEX specifies the Delegation Index of the task and so within the task, you will be redirected to the Dynaform with the particular UID(i.e. 60422430056a69386a2a885087313352)

You can use this code in a trigger and not in Javascript. So, include this line of code in a trigger and place the trigger after the Dynaform from where you want to get redirected.

For further details about this function, you can refer the following link:
http://wiki.processmaker.com/3.0/Proces ... Step.28.29

Hope this helps

Best Regards
Mishika