Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
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

Being the best in the started business is the obje[…]

Winzo is a popular and unique game on the mobile p[…]

Cannot create process using templets

Real details. The problem was solved by effect!

However, it is essential to use it responsibly and[…]