I have a function that will generate a report and email it to the user. I want to run this code on a schedule without any user interaction and no user forms.
At the moment, I run the code in the before page event of a form but I don't want to do it this way since there is no user interaction and when the before page event finishes, the form is left open and cannot be closed since browsers don't allow non-popup windows to be closed by scripts.
I tried setting up a schedule in the scheduler to point to this form and manually triggered it but it doesn't seem to work at all this way.
Any suggestions as to how I can do this ?
EXecute code without user interaction
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 649
- Joined: Mon Dec 09, 2013 6:37 pm
-
- Ebase User
- Posts: 331
- Joined: Mon Mar 10, 2014 8:34 am
-
- Ebase User
- Posts: 649
- Joined: Mon Dec 09, 2013 6:37 pm
Steve,
That is very similar to what I am doing except that my form generates an Excel document and emails it to a list of users.
I did create a schedule already and chose form runner for the program. I entered the form name as the value for FORM_ID.
For testing purposes, I set the Schedule Information to None, checked "Can be triggered" and entered a name for the trigger id MYREPORT.
When I try to execute the task from the command line by doing ebasetrigger -user myusername -password mypassword MYREPORT, it says "Return code 0 received from Ebase Server" which is the return code for a successful run but the document never gets generated. It doesn't seem as though my form is ever getting executed.
When I load the form manually like I would for any form, it does correctly generate the document and emails it out.
Here is the output from the scheduler log:
That is very similar to what I am doing except that my form generates an Excel document and emails it to a list of users.
I did create a schedule already and chose form runner for the program. I entered the form name as the value for FORM_ID.
For testing purposes, I set the Schedule Information to None, checked "Can be triggered" and entered a name for the trigger id MYREPORT.
When I try to execute the task from the command line by doing ebasetrigger -user myusername -password mypassword MYREPORT, it says "Return code 0 received from Ebase Server" which is the return code for a successful run but the document never gets generated. It doesn't seem as though my form is ever getting executed.
When I load the form manually like I would for any form, it does correctly generate the document and emails it out.
Here is the output from the scheduler log:
Code: Select all
05/15/2015 15:03:31 Execution started for scheduled task id 1001
05/15/2015 15:03:31 MYREPORT, program com.ebasetech.ufs.batch.FormRunner
05/15/2015 15:03:31 User: Segi
05/15/2015 15:03:31 Execution of form TRACKER_REPORT successful
05/15/2015 15:03:31 Execution completed with return code 0
0 x
-
- Ebase User
- Posts: 331
- Joined: Mon Mar 10, 2014 8:34 am
Try moving your logic into the before form event rather than before page.
Form Runner
This program executes the specified form, running the before-form and after-form events. All other events are ignored. It is not possible at this time to pass parameters to the form.
http://portal.ebasetech.com/cp//doc/sch ... c333843234
0 x
-
- Ebase User
- Posts: 649
- Joined: Mon Dec 09, 2013 6:37 pm
Who is online
Users browsing this forum: No registered users and 23 guests