Default Value in Dictionary Entry using Javascript

Katelyn1
Kilo Expert

Hey everyone!

I am trying to create a dictionary entry with a default value to be assigned as the name of the user that is signed in. I found some other questions in the community with this question so i was able to get the code from there, but it is telling me this is an invalid default value. This is what I have so far: 

javascript: current.u_requested_for = gs.getUserDisplayName();

I have the type for this dictionary entry as Reference and it is referring to sys_user. My column label name is Requested For, so respectively my column name is u_requested_for. Is my code wrong for this? Is this even allowed what I am trying to do? Is there a different way to go about doing this? 

 

Thanks!

1 ACCEPTED SOLUTION

Anurag Tripathi
Mega Patron
Mega Patron

Hi Katelyn,

 

This should be the default value if you want to add the logged in user to a user reference field.

javascript:gs.getUserID();

 

-Anurag

-Anurag

View solution in original post

6 REPLIES 6

vkachineni
Kilo Sage
Kilo Sage

Since it is a Reference field

can you try 

 

javascript:gs.getUserID();

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

Unfortunately it still says that is an invalid default value.