How to auto populate the logged in user details using onload client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2022 01:43 AM
Hi All,
I have a requirement where I have created multiple variables - RequestedFor, RequestedBy, Location, City, Country, MobileNumber, ManagerName and incidentLists
1.user opens the form above details auto populate with logged in user
2.on change of user, above details to be changed auto change based on the user change
3.incidenlists var only be visible on the form once the all the user details entered
4.populate all the list of incidents raised by selcted user - reqfor
Please help me to achieve this requirement
Thanks&Regards,
Sweety.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2022 06:07 AM
Hi aman.
I have achived the 3rd requriment.
1.I have set the default values to the variables for auto population of the logged in user. like javascript:gs.getuserID(); , .... but I can't able to set it for city and country.
2. written the above onChange and script include it's not working.
obj.ulocation = gr.getDisplayVaue('location');
Can you please help to correct the script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2022 06:22 AM
did you check script logs, what are you getting there?
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2022 06:27 AM
I didn't checked. Can you tell me how to check it

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2022 07:05 AM
Go to application navigator, enter "Script log statements", there you can see the relevant rows:
you can search in message "*test json" in message column
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2022 07:27 AM
Hey Aman,
I'm not getting any message related to *test json.
But I can able to achieve this onChange script. One thing is still a question mark?
How to display city & country using, I have tried in this way javascript:gs.getUser.getRecord.getDisplayValue('city') , it's not populating. Can you please help me out.
Regards,
Sweety.