Skip to Content
0

xsjs failed with error(s): undefined is not a function (line 0 position 1 in ?)

Apr 30 at 11:07 PM

56

avatar image
Former Member

I have created a XSJS script and it runs well if I execute if from HANA studio or Web IDE, but when I schedule the job, it errors out with following message :

xsjs failed with error(s): undefined is not a function (line 0 position 1 in ?)

This is how my xsjob looks like:

{

"description": "Hello",

"action": "ODATA_SVC:TestHCIContacts_Multiload1.xsjs::",

"schedules": [

{ "description": "new job", "xscron": "* * * * 22 10 0" }

]

}

My XSJS script does not have any parameter or a function.

If I use "action": "ODATA_SVC:TestHCIContacts_Multiload1.xsjs" in my xsjob the job does not activate. It gives parsing error for action.

Any help to resolve this issue is highly appreciated.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member May 01 at 07:37 PM
1

I was able to resolve this issue.

I had to edit my xsjs file and enclose entire xsjs script in a function block

function My_Test()

{

.......xsjs script

}

and then I updated my xsjob file

{

"description": "Hello",

"action": "mypkg:Test.xsjs::My_Test",

"schedules": [

{ "description": "new job", "xscron": "* * * * 18 50 0" }

]

}

Show 1 Share
10 |10000 characters needed characters left characters exceeded

indeed you must specify the name of the function you need to run - good catch on your own question :)

0