How to assign value to Reference field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2022 11:21 AM
Hi all,
I'm capturing string field value using GlideRecord() and want to assign it to Reference Field. How I can assign it to Reference Field.
var gr = new GlideRecord('u_stm_sub_data');
gr.initialize();
gr.u_stm_status = current.u_stm_global_status; //u_stm_status is Stringfield & u_stm_global_status is Reference field.
gr.u_stm_details = current.u_stm_global_details;
gr.u_service_type = current.u_service_type;
gr.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2022 11:27 AM
Maybe try following?
var gr = new GlideRecord('u_stm_sub_data');
gr.initialize();
gr.u_stm_status = current.u_stm_global_status.getDisplayValue(); //u_stm_status is Stringfield & u_stm_global_status is Reference field.
gr.u_stm_details = current.u_stm_global_details;
gr.u_service_type = current.u_service_type;
gr.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2022 11:27 AM
hii,
go through the above link hope it helps:
Mark Correct or Helpful if it helps.