Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#823984
I have a case where the user needs to upload a CSV file and save the record to the database, and they are often complaining about the record that is not saved to the database although they already upload the file. After I checked it through debugging mode, I found that their upload was not successful. Can I show the error message as a pop-up message to the user without enabling debugging mode?
#824003
You can use a trigger like this:
Code: Select all
//set to the ID of the Dynaform where File is uploaded:
$dynaformId = '1234567890abcdef1234567890abcdef'; 

if (isset(@@__ERROR__)) {
    $err = @@__ERROR__;
    $g = new G();
    $g->SendMessageText($err, "ERROR");
    unset(@@__ERROR__); //clear error so it won't be detected the next time
    //if you want the case to return to the Dynaform where file failed in uploading:
    PMFRedirectToStep(@@APPLICATION, @%INDEX, 'DYNAFORM', $dynaformId);
} 

If you are checking the upload of a File field, then set this trigger to fire before the next step or before assignment if the Dynaform is the last step in the task. Do not set it to fire after the dynaform because at that point the file as not yet been saved in the database and placed in the server's file system.
See:
https://wiki.processmaker.com/3.0/Inter ... Text.28.29
https://wiki.processmaker.com/3.1/Proce ... Step.28.29

Thanks!

Hi, This user API https://wiki.processmaker.com/[…]

display pdf in panel control

Is there any solution?