EXecute code without user interaction

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

EXecute code without user interaction

#1

Postby Segi » Fri May 15, 2015 7:01 pm

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 ?
0 x

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#2

Postby Steve James » Fri May 15, 2015 10:06 pm

Hi Segi, yes scheduler is one way to go in Ebase using the 'form runner', we used to have a job that ran daily to generate a csv and ftp it with email confirmation.
0 x

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#3

Postby Segi » Fri May 15, 2015 11:03 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:

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

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

#4

Postby Steve James » Sat May 16, 2015 7:28 pm

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

Segi
Ebase User
Posts: 649
Joined: Mon Dec 09, 2013 6:37 pm

#5

Postby Segi » Mon May 18, 2015 5:16 pm

Steve,

Thanks, that fixed the issue and now my code is being executed.
0 x


Who is online

Users browsing this forum: No registered users and 23 guests