is my script include and client script is correct or not to get the user full name in description
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2025 04:34 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2025 06:07 AM
Hi @srilekhac ,
yeah it seems correct, but why are you logging message in script include.
Remove the gs.log() line. It is already returning the full name of use to called functions.
Good script!
Thanks,
Bhimashankar H
-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2025 06:25 AM
client callable script should not have initialize() method
This will work provided you are making the correct GlideAjax syntax from client side
1) if client script and script include are in different scope
-> make sure you call the script include with the API name
-> make Accessible from -> All Application Scope
2) if client script and script include are in same scope -> no worry
var GetUserFullName = Class.create();
GetUserFullName.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getFullName: function() {
var user = gs.getUser();
var fullname = user.getFirstName + " " + user.getLastName();
gs.info("Full name retrieved: " + fullname, "GetUserFullName");
return fullname;
},
type: 'GetUserFullName'
});
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
07-27-2025 08:15 PM
Hope you are doing good.
Did my reply answer your question?
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
07-25-2025 06:29 AM
Hello @srilekhac
You just provided script include which has logic proper but the script include if it need to called from Client Script the script include must be marked as client callable. Once that is done your client script will be able to call script include.
Also, in your code the concatenate logic you have use is also fine but there is another method you can utilize
var user = gs.getUser();
var fullname = user.getDisplayName(); // this will get fullName of login user.
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.