Questions and discussion about using ProcessMaker: user interface, running cases & functionality
#823440
The easiest way is to create an Output Document whose template has the variables from the Dynaform. For example, if your Dynaform has the variables "clientName" and "clientAddress", then the template would be:
Code: Select all
Client Name: @#clientName

Client Address: @#clientAddress
Then, set the Output Document as a step in the last task in the process.

If you don't want the user to see the Output Document step, then create the following trigger:
Code: Select all
//set to the ID of the Output Document:
$outDocId = '1234567890abcdef1234567890abcdeg';
PMFGenerateOutputDocument($outDocId);
Set this trigger to fire before assignment in the last task in the process.

PS: if you want to generate this Output Document in a trigger that is fired immediately after the Dynaform which contains the "clientName" and "clientAddress" fields, then you will need to use a trigger like this to generate the Output Document:
Code: Select all
//set to the ID of the Output Document:
$outDocId = '1234567890abcdef1234567890abcdeg';
$aVars = array(
    "clientName" => @@clientName,
   "clientAddress" => @@clientAddress
);
PMFSendVariables(@@APPLICATION, $aVars);
PMFGenerateOutputDocument($outDocId);
#823484
Does hiding the Output Document step means not showing this screen?
Screenshot_4.jpg
Screenshot_4.jpg (14.22 KiB) Viewed 4285 times
Will it automatically generate a document when Submit button is pressed?
Capture.JPG
Capture.JPG (13.68 KiB) Viewed 4285 times
I also want to know if a generated document can also be automatically attached in an email that will be sent to the user.

Thank you in advance!
#823496
cabrerabenj wrote:Does hiding the Output Document step means not showing this screen?
Yes. Instead of having an Output Document step in your process that the user will see, you use a trigger with the PMFGenerateOutputDocument() function that generates the Output Document file for the case, which the user won't see.
cabrerabenj wrote:I also want to know if a generated document can also be automatically attached in an email that will be sent to the user.
You need to use a trigger to do this. You can generate the Output Document either with a step or with PMFGenerateOutputDocument() in a trigger. Then, use the code shown in "Example Emailing Generated Output Document Files".
#823497
cabrerabenj wrote:Will it automatically generate a document when Submit button is pressed?
If you set a trigger to fire after the Dynaform that contains PMFGenerateOutputDocument(), then it will generate the Output Document file immediately after you click on the "Submit" button.
#823531
cabrerabenj wrote: Sun Mar 24, 2019 11:39 pm What is the location/ where can I see the automatically generated Output Document when Submit button is generated? Is it possible to see the generated file automatically on the bottom side of the browser?
If you want the user to see to the generated file, then you should to use an Output Document step and not use PMFGenerateOutputDocument().

Then fire a trigger after the Output Document step that looks up the Output Document file in the database and sends the Output Document file as an attachment with PMFSendMessage() as explained in the code sample that I gave you a link to.

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[…]