How to auto populate the logged in user details using onload client script

Sweety11
Kilo Contributor

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.

22 REPLIES 22

I think you are missing the brackets, In default value: 

javascript:gs.getUser().getRecord().getValue('country');
javascript:gs.getUser().getLocation();

 

If you want display value:

javascript:gs.getUser().getRecord().getDisplayValue('city') 

Best Regards
Aman Kumar

If you are working in global, it should work fine.

Best Regards
Aman Kumar

I'm working global, then also it's not working

You location and city fields are string or reference?

Best Regards
Aman Kumar

location is reference, city and country are single line text