update document id field using glide record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 01:48 AM
Hello,
I want to update the document id field need to be updated.Can some one please help me with this?
Below code not working
var gr = new GlideRecord('new_call');
gr.initialize();
gr.caller = conversation.document.opened_by;
gr.opened_by = gs.getUserID();
gr.contact_type = "chat";
gr.insert();
var gr2 = new GlideRecord('chat_queue_entry');
gr2.addQuery('sys_id',id);
gr2.query();
if(gr2.next())
{
gs.log('Aug 7 ::: chat_queue_entry');
gr2.source_table ='new_call';
gr2.document_id=gr.sys_id;
gr2.update();
}
Thanks
Saranya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 01:53 AM
Use the below code and try.
var gr = new GlideRecord('new_call');
gr.query();
//gr.initialize();// It will use for the creation of new record and not useful for uopdate so remove this.
gr.caller = conversation.document.opened_by;
gr.opened_by = gs.getUserID();
gr.contact_type = "chat";
//gr.insert();
gr.update();
var gr2 = new GlideRecord('chat_queue_entry');
gr2.addQuery('sys_id',id);
gr2.query();
if(gr2.next())
{
gs.log('Aug 7 ::: chat_queue_entry');
gr2.source_table ='new_call';
gr2.document_id=gr.sys_id;
gr2.update();
}
ServiceNow Commnunity MVP -2018 class.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 02:16 AM
Hello Karthik,
I am want to insert call record and update document id in the chat queue entry table.
Thanks
Saranya