- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 05:05 AM
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!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 06:22 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 05:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 05:30 AM
Hi Ravi,
Thanks for the reply!
Actually, it is a mandatory field, so, Shouldn't I write an onLoad Client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 05:56 AM
If you write above onchange script then it will execute on setting of the Caller ID so it will set the phone number on load of the form itself.
Write this script and let me know if you need any help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2016 06:22 AM
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