- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 03:03 AM
I have created a Onload Catalog client script retrieve the first date of current month and below is the code -
script include script -
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 03:10 AM
script should not have any dependency with the user who is logged in
Is the user for whom it's not working an external user?
Also check the ACL which is added on Client callable script include, what role is given there.
May be the other user doesn't satisfy the ACL role and hence Ajax call is not happening
if the user is external then add this function in your script include so that external user is able to make GlideAjax call
in your client callable script include add the isPublic function along with your existing functions
isPublic: function(){
return true;
},
check this link
Privacy on client-callable script includes (instance security hardening)
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 03:10 AM
script should not have any dependency with the user who is logged in
Is the user for whom it's not working an external user?
Also check the ACL which is added on Client callable script include, what role is given there.
May be the other user doesn't satisfy the ACL role and hence Ajax call is not happening
if the user is external then add this function in your script include so that external user is able to make GlideAjax call
in your client callable script include add the isPublic function along with your existing functions
isPublic: function(){
return true;
},
check this link
Privacy on client-callable script includes (instance security hardening)
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 03:35 AM
Hi Ankur , the Script include's ACL was having a role which was missed in user profile. Thanks for the quick help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 03:35 AM
Glad to help.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 03:18 AM
what's your business requirement?
do you want 1st day of current month and set that in date variable ?
if yes then use this default value of that variable and make it readonly
javascript: var currentDate = new GlideDateTime();
currentDate.setDayOfMonthUTC(1);
var firstDayOfMonth = currentDate.getLocalDate();
firstDayOfMonth;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader