Page 1 of 1

Search and Open draft webEntry case

Posted: Tue Jul 09, 2019 4:55 am
by justinopsky
I need to search and open paused webentry cases, withou lost the data on them.
Because the cases on webentry are using guest user, so i cant open them.
There is any way to this?

Thanks

Re: Search and Open paused webEntry case

Posted: Tue Jul 09, 2019 8:14 am
by cosyxu
Hi,

I have the same questions...not sure if that is possible, when I use web-entry form function with the Guest user, if the user close the web-entry form, user will lost data(we have some large form that may take 20mins to complete).

Then when they refresh or reopen the form again, ProcessMaker will create a new session to start a new case so that user won't be able to continue our original case...therefore, if user can go back to the original case and the form can restore all previous data that they entered, that will be great.

Otherwise it will just create more and more draft cases.

Thanks and regards,
Yuan

Re: Search and Open draft webEntry case

Posted: Tue Jul 09, 2019 8:44 pm
by amosbatto
There is no easy way to deal with this problem. No case is created until the user presses the submit button on the web entry form, so there is no data to be retrieved. You could REST to create the case after a 30 seconds and automatically save the data, but then you have a problem if the user decides to not submit the web entry, because doesn't want to continue.

I think that the best solution is to show a warning message if the user tries to unload the page. I added a page to the PM Users wiki to explain how to do this:
https://www.pmusers.com/index.php/Warni ... Entry_form

Re: Search and Open draft webEntry case

Posted: Tue Jul 09, 2019 9:38 pm
by cosyxu
amosbatto wrote: Tue Jul 09, 2019 8:44 pm There is no easy way to deal with this problem. No case is created until the user presses the submit button on the web entry form, so there is no data to be retrieved. You could REST to create the case after a 30 seconds and automatically save the data, but then you have a problem if the user decides to not submit the web entry, because doesn't want to continue.

I think that the best solution is to show a warning message if the user tries to unload the page. I added a page to the PM Users wiki to explain how to do this:
https://www.pmusers.com/index.php/Warni ... Entry_form
Hi Amo,

That's actually a good idea. :idea:

By implementing this, user will get notice if they try to reload the page, can we also notice them if they try to close the browser?

Thanks
Yuan

Re: Search and Open draft webEntry case

Posted: Wed Jul 10, 2019 3:37 am
by justinopsky
Thank you

I agree, with the approach, it's a good idea, so the user already gets the information that the information will not be submitted.

Now if he confirms that you want to close the browser, can we close the case by javascript, and even notify the admin that case was closed?

Other option is if a case stay more then 1 day on draft status, the processmaker close the case automatically, can be done?

Re: Search and Open draft webEntry case

Posted: Wed Jul 10, 2019 5:11 am
by justinopsky
amosbatto wrote: Tue Jul 09, 2019 8:44 pm There is no easy way to deal with this problem. No case is created until the user presses the submit button on the web entry form, so there is no data to be retrieved. You could REST to create the case after a 30 seconds and automatically save the data, but then you have a problem if the user decides to not submit the web entry, because doesn't want to continue.

I think that the best solution is to show a warning message if the user tries to unload the page. I added a page to the PM Users wiki to explain how to do this:
https://www.pmusers.com/index.php/Warni ... Entry_form
I tested this solution and the processmaker displays the warning message when you try to close the browser window and when the form is submitted.
Should not you just present the message when you close the browser window?

Re: Search and Open draft webEntry case

Posted: Wed Jul 10, 2019 7:39 am
by justinopsky
Is it possible to use the following example to assign the drafted cases to the administrator's inbox?
https://www.pmusers.com/index.php/Form_ ... _for_cases

Re: Search and Open draft webEntry case

Posted: Wed Jul 10, 2019 7:27 pm
by cosyxu
justinopsky wrote: Wed Jul 10, 2019 5:11 am
amosbatto wrote: Tue Jul 09, 2019 8:44 pm There is no easy way to deal with this problem. No case is created until the user presses the submit button on the web entry form, so there is no data to be retrieved. You could REST to create the case after a 30 seconds and automatically save the data, but then you have a problem if the user decides to not submit the web entry, because doesn't want to continue.

I think that the best solution is to show a warning message if the user tries to unload the page. I added a page to the PM Users wiki to explain how to do this:
https://www.pmusers.com/index.php/Warni ... Entry_form
I tested this solution and the processmaker displays the warning message when you try to close the browser window and when the form is submitted.
Should not you just present the message when you close the browser window?
My apologize, for some reason, it works now.... :D

Thanks
Yuan

Re: Search and Open draft webEntry case

Posted: Wed Jul 10, 2019 10:24 pm
by amosbatto
justinopsky wrote: Wed Jul 10, 2019 7:39 am Is it possible to use the following example to assign the drafted cases to the administrator's inbox?
https://www.pmusers.com/index.php/Form_ ... _for_cases
Yes, that code should work in any Dynaform.

Re: Search and Open draft webEntry case

Posted: Thu Jul 11, 2019 7:08 am
by justinopsky
amosbatto wrote: Wed Jul 10, 2019 10:24 pm
justinopsky wrote: Wed Jul 10, 2019 7:39 am Is it possible to use the following example to assign the drafted cases to the administrator's inbox?
https://www.pmusers.com/index.php/Form_ ... _for_cases
Yes, that code should work in any Dynaform.
i created dropdown with a list of useres, and use PMF Derivate Case do route the case to admin, but dont't work, can you help me?

Re: Search and Open draft webEntry case

Posted: Thu Jul 11, 2019 11:02 am
by justinopsky
justinopsky wrote: Wed Jul 10, 2019 5:11 am
amosbatto wrote: Tue Jul 09, 2019 8:44 pm There is no easy way to deal with this problem. No case is created until the user presses the submit button on the web entry form, so there is no data to be retrieved. You could REST to create the case after a 30 seconds and automatically save the data, but then you have a problem if the user decides to not submit the web entry, because doesn't want to continue.

I think that the best solution is to show a warning message if the user tries to unload the page. I added a page to the PM Users wiki to explain how to do this:
https://www.pmusers.com/index.php/Warni ... Entry_form
I tested this solution and the processmaker displays the warning message when you try to close the browser window and when the form is submitted.
Should not you just present the message when you close the browser window?
Using this code i can now control if the user close the browser windows or if submit the form
Code: Select all
window.onbeforeunload = function() {
  //remove the spinning circles that signify that the page is loading or submitting:
  var spinner = $(".spinner-icon");
  if (spinner.length) {
    spinner.removeClass("active-spinner");
  }
  
  //modern web browsers will show generic message instead of the custom message
  return "Are you sure that you want to leave and lose any data entered in this form?";
}                 
var formId = $("form").prop("id");
getFormById(formId).setOnSubmit( function() {
window.onbeforeunload = null;
});

Re: Search and Open draft webEntry case

Posted: Thu Jul 11, 2019 9:30 pm
by amosbatto
justinopsky wrote: Thu Jul 11, 2019 7:08 am i created dropdown with a list of useres, and use PMF Derivate Case do route the case to admin, but dont't work, can you help me?
Start a new thread and either post the .pmx file for your process or post your trigger code if you don't want to post your process.