Questions and discussion about using ProcessMaker 2: user interface, running cases and functionality
Forum rules: Please search to see if a question has already been asked before posting. Please don't ask the same question in multiple forums.
By hdobbs
#790570
My process has a email that is sent to the user which allows them to login and go directly to the Task that is assigned to them. The link I use is created from information I found on the ProcessMaker wiki:

Open an existing case: "../cases/cases_Open?APP_UID=<CASE-UID>&DEL_INDEX=<INDEX>"

The link works great but have recently found out that after the user uses it to submit their task if they click on the link again the dynaform appears just like the first time and appears as if they can submit it again. Is there any way to send them a link that after submitted wont show the dynaform and they will know that the dynaform has been submitted and has been routed to the next step?

Thanks!
User avatar
By amosbatto
#790591
That link will show the first step in the task indicated by the delegation index number. After the task has been completed, that link will no longer show an editable step, but will show the case summary.

If your task only has one DynaForm step, then you can add a trigger after the DynaForm that calls PMFDerivateCase() to route on the case to the next task in the process. That way the user can only fill out the form once and will see the case summary if the user clicks on the link twice.

If you want the user to be able to save his/her data, without routing on the case, then you can add different buttons to your DynaForm. See:
http://wiki.processmaker.com/3.0/Submit ... n_triggers

Another option is to add a hidden field to your DynaForm to indicate whether it has already been edited. For example, you could add
a hidden field whose ID and associated variable is named "submitCount" whose default value is 0 (zero). Then add this JavaScript to the form to hide the content of the form if already submitted:
Code: Select all
//if the DynaForm has already been submitted, then hide its contents and display a message
if ($("#submitCount").getValue() != "0") {
  //hide all content in form:
  $("div.pmdynaform-field").hide();
  //add message and buttons to reshow form or go to the cases list :
  var content = '<div id="contentHidden"><p>The form has already been submitted.</p>' +
    '<p><button type="button" id="showForm">Show Form</button> <button type="button" id="casesList">Go to Cases List</button></p></div>';
  $("form").append(content);
  // add click event handlers to the buttons:
  $("#showForm").click( function() { 
     $("div.pmdynaform-field").show();
     $("#contentHidden").hide();
  });
  $("#casesList").click( function() { 
     top.location.href = "main";
  });
}
     
//increment the submitCount when the form is submittted:
form = getFormById( $("form").prop("id") );
form.setOnSubmit( function() {
  var nSubmits = parseInt( $("#submitCount").getValue() ); 
  $("#submitCount").setValue(nSubmits + 1);
});
Here is a sample process to test it:
(29.39 KiB) Downloaded 357 times

Experience heightened pleasure with Cenforce 100 M[…]

Get an instant solution to move emails to MBOX for[…]

Most Demanding OST to PST Converter

The most demanding OST to PST Converter is TrijaT[…]

Betvisa clone scripts are pre-built software solut[…]