Questions and discussion about using ProcessMaker: user interface, running cases & functionality
By pmuser317
#794529
Hello all,

i have a question about a process with Dynaforms. I have a Dynaform with a submit button over web entry. After the user klicks on submit, an email notification should send to the assigned user (maybe with the content of the Dynaform as Pdf?) and a fresh Dynaform (the same) should be opened after that.

I have searched the forum and the wiki a long time, tried a lot of settings, but i can not solve my issue. How it can be done?

It would be great if anyone can help me.

Many thanks!
User avatar
By amosbatto
#794554
When you create a web entry, a new file will be created at the following location on your PM server:
<INSTALL-DIR>/processmaker/shared/sites/<WORKSPACE>/public/<PROCESS-UID>/<WEB-ENTRY-EVENT-UID>Post.php
For example:
/opt/pm3.2/shared/sites/workflow/public/2020347645994f428e40689088138327/2977364985994f44d536393055365926Post.php

Run a case and look in the debugger at the PROCESS variable to find the process ID.

Edit that file with a plain text editor and change line 156 from:
Code: Select all
        $aMessage["MESSAGE"] = "<br />Case created in ProcessMaker<br />Case Number: $caseNr <br />Case Id: $caseId<br />Case derivated to: $assign";
    } else {
To something like:
Code: Select all
        $aMessage["MESSAGE"] = "<br />Case created in ProcessMaker<br />Case Number: $caseNr <br />Case Id: $caseId<br />Case derivated to: $assign";
        header("location: http://localhost:320/sysworkflow/en/neoclassic/2020347645994f428e40689088138327/2977364985994f44d536393055365926.php");
    } else {
Where http://localhost:320/sysworkflow/en/neo ... 365926.php is the web address for the web entry form found in the properties of the web entry. (It was generated when the web entry was first created.)

This will redirect the web entry back to the original form instead of showing information about the new case. If you want to send out an email, you will have to add code in the same place that calls the sendMessage() web service. If I have time, I will write a code sample that you can use, so check back later on this thread.
#794557
Many thanks for your help. I added the code, but then i get only a warning message after i submit the Dynaform.
Warning.JPG
Warning.JPG (43.69 KiB) Viewed 3760 times
Whats wrong?

---------
Update:
Got it working by commenting out:
Code: Select all
    $G_PUBLISH = new Publisher();
    $G_PUBLISH->AddContent("xmlform", "xmlform", "login/showInfo", "", $aMessage);
    G::RenderPage("publish", "blank");


It would be great, if you can post the sendMessage() code sample later.
#794579
I don't recommend your solution, because you won't be able to see whether an error occurred. The warning indicates that you aren't doing the redirection back to the Web Entry Form correctly. You probably aren't using the link to the web entry form or have a new line in your link. Post your code.

Another thing to try is adding a die like this:
Code: Select all
        $aMessage["MESSAGE"] = "<br />Case created in ProcessMaker<br />Case Number: $caseNr <br />Case Id: $caseId<br />Case derivated to: $assign";
        header("location: http://localhost:320/sysworkflow/en/neoclassic/2020347645994f428e40689088138327/2977364985994f44d536393055365926.php");
        die;
    } else {
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]