Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Catalog Client Script (GlideAjax) throwing error on Portal "There is a JavaScript error ........"

chatsaurav19
Tera Contributor

Hi Team,

 

While using a CCS, ( attached screen shot ) in which I have made a GlideAjax call, I am getting a error stating "There is a JavaScript error in your browser console". The values are getting populated in the back end instance while 'try it' but in portal it is throwing the error. 

 

I need the data to populate the Catalog Item Fields on the Portal. Any suggestion as to how can I achieve this?

 

Regards,

Saurabh

1 ACCEPTED SOLUTION

@chatsaurav19 

 

It seems that g_user.getUserID() is not supported in Service portal 

https://www.servicenow.com/community/developer-forum/g-user-getuserid-alternate-options-in-service-p...

 

 

You can do one thing instead of sending it from front end, please get the loggedin user in the backend itself as gs.getUserID() (inside script include);

 

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.

View solution in original post

6 REPLIES 6

@chatsaurav19 

 

It seems that g_user.getUserID() is not supported in Service portal 

https://www.servicenow.com/community/developer-forum/g-user-getuserid-alternate-options-in-service-p...

 

 

You can do one thing instead of sending it from front end, please get the loggedin user in the backend itself as gs.getUserID() (inside script include);

 

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.

Hi @Prince  This worked! Thanks a lot!