How to set value to reference field using sys_id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2016 02:37 AM
Hi all,
I am having sys_id of company name and i want to set that company name to reference field using sys_id.So how to do it?Please anyone can tell?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2016 03:04 AM
Just set the sys_id to reference field, it will work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2016 03:16 AM
Hi Anurag,
I tried but the value is not setting to field.Its empty only.
Thanks,
Nikhil

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2018 02:49 AM
It can be set to a reference fields value using : g_form.setValue('your_fields_name', 'the sys_id of the field');
So it wouldn't work if you try to set it to a field that isn't a Reference type field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2016 03:05 AM
write a on load client script.
use script :
g_form.setValue('NameOfTheCompanyField','paste_sys_id_here'); // provide the field name and sys_id in place of bold test.
Thanks,
Mihir