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.
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?
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: ... Text.28.29 ... Step.28.29
attach file

Hi all. i upload input document to the process. Bu[…]

Hi Amos, Thanks again. The next task is a "Va[…]

Hi Amos, problem fixed. The field variable and th[…]

Hi Amosbatto. I apologise, I have been away for w[…]