Highlighted
Absent Member.
Absent Member.
1247 views

jscall not working/.

Hi,


i had written a script and i had saved it in the script library in base utilities package.

And i am trying to invoke this script in the notification using jscall("Script.function") but it shows some us.notify error. Actually this script returns a number.

I tried this also $result = jscall("OpenIncidentCount.Count"); but this showing the same error.


Please tell me where i am doing mistake.

Thanks & Regards,
Mayank
0 Likes
9 Replies
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: jscall not working/.

have you verified that the script works? Are you able to call it from RAD Debugger?
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: jscall not working/.

If the script returns a number variable, and you are using it as an argument for gnererating a message. Then there could be a "type-mismatch". Try returning the number as a string value in your script. Or define the argument as {"\""+jscall("OpenIncidentCount.Count")+"\""}.
Hope this helps
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: jscall not working/.

hi Jacob,

As you said i invoked my script from RAD Debugger. Its working fine but still the same error exists.

Regards,
Mayank
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: jscall not working/.

Hi Brian,

I tried {"\""+jscall("OpenIncidentCount.Count")+"\""}this also, but still in notification it is not able to find this as argument.

And it's not unable to find str function which i used to convert my number to a string.
Any other things, i need to check to make it work.

Regards,
Mayank
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: jscall not working/.

Hi Mayank,
You could try testing the script directly and add some prints. The print statements are viewable in the "messages view" window, and can help isolate were the error is occuring.
Add these 3 lines to the bottom of your script file (outside the function).
print ("OpenIncidentCount.Count Script has started")
var strValue = Count
print("The Value Returned = *"+ strValue +"*")

Additional Prints could be added within the function. But this is where I would start.

After saving the file, compile it (this check for errors), then execute it and review the results.

If everything is OK at this point then, go through the steps to trigger the notification event. Look for your print statements from the srcipt.
If you still cannot issolate, post the errors back here for us to review.

Brian
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: jscall not working/.

hi Brian,

i did work with print as you said, its working fine.
But i think it is not returning anything as i ran this command with RAD debugger, it did not return anything. But due to print statements, i could see that script is working fine.
RAD Debugger :-
d {"\""+jscall("OpenIncidentCount.OpenIncidentCount")+"\""}

It returned {}, empty braces. But why it is happening? Please suggest something so that i can return the value.

Regards,
Mayank

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: jscall not working/.

hi Brian,

Thanks for your replies.
NOw its working fine, a small mistake was there.

Thanks & Regards,
Mayank
0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: jscall not working/.

Can you tell me what did you do? I have the same problem!!!!

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: jscall not working/.

To resolve any problem need more detail about it.

-Script text

-Text of call this script

-full message about error (it may be several lines)

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.