- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2021 04:00 AM
Internal Explanation required for me.
var newUser = gs.getUser ();
gs.print (newUser.getUserByID ('abel.tuter').getFirstName ());
I didnot understand this, kindly explain line by line.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2021 07:26 AM
Hi
gs.getUser() -since it gives you a reference to the user object for the current user, it means you are getting control access to the whole user object.
If you use below code
var newUser = gs.getUser();
gs.print (newUser.getFirstName());
since you didn't mention any specific user for whom you need first name, it will give you your firstname i.e., current logged in user first name
but you have choosed the user_name in getUserByID ('abel.tuter'), so within the users list, it will identify which user has this UserID -abel.tuter and gives you that user firstname.
Methods does not serve always one purpose , based your requirement you extend your code to use it more.
Here is another link which might be useful for you
https://sn.jace.pro/docs/glideuser/
Kindly mark the response correct and helpful, once your issue is resolved and close the thread for others benefit in future
BR,
Harika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2021 07:26 AM
Hi
gs.getUser() -since it gives you a reference to the user object for the current user, it means you are getting control access to the whole user object.
If you use below code
var newUser = gs.getUser();
gs.print (newUser.getFirstName());
since you didn't mention any specific user for whom you need first name, it will give you your firstname i.e., current logged in user first name
but you have choosed the user_name in getUserByID ('abel.tuter'), so within the users list, it will identify which user has this UserID -abel.tuter and gives you that user firstname.
Methods does not serve always one purpose , based your requirement you extend your code to use it more.
Here is another link which might be useful for you
https://sn.jace.pro/docs/glideuser/
Kindly mark the response correct and helpful, once your issue is resolved and close the thread for others benefit in future
BR,
Harika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2021 08:28 AM
Thank you for your answer and explanation. I totally understood. Thanks again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2021 08:38 AM
Happy to help 🙂