Auto fill phone number from User table

pratibha4
Kilo Contributor

I have a form in the service catalog for ordering an item. The first field in the form is a reference field to sys_user. This field is auto-filled with the name of the person ordering the item.

And the second field is the phone number of the user.I want to fetch this phone number from the user table, so I have made this a Reference field of the user table. And in the default value, I am using : javascript:gs.getMobileNumber()

But it is not working. Do I need to use client script for this?

Any help would be appreciated. Thanks!

1 ACCEPTED SOLUTION

Hello Pratibha:


You can create the user object, you can get any objects related to the user, like phone number, location etc;


var myUserObject = gs.getUser()
myUserObject.getMobileNumber() will return the mobile phone number of the user.


Hope this helps



P.S Mark it correct or helpful.


Regards


Danny


View solution in original post

5 REPLIES 5

Thanks!!


It worked.