getClientData in server side?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2020 07:07 AM
Hi Folks,
The below code is written in business rule,what the below highlighted code will do and what exactly this gs.getSession().getClientData('dontcopy') == 'true') means in BR.
Because of this sometimes comments are not copying to SC_task.
if(gs.getSession().getClientData('dontcopy') == 'true'){
gs.getSession().putClientData('dontcopy', false);
return;
}
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item', current.sys_id);
gr.query();
while(gr.next())
{
gs.getSession().putClientData('dontcopy', true);
gr.work_notes = current.work_notes;
gr.comments = current.comments;
gr.update();
}
Regards,
Vijay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2020 07:29 AM
Hi Vijay,
There is some value set by putClientDatain client script that is being fetched by this getClientData in business rule method.
To read more in details refer the below link:
https://developer.servicenow.com/app.do#!/api_doc?v=orlando&id=r_GlideSessionGetClientData_String
Mark my ANSWER as CORRECT and HELPFUL if it works.
Also refer what is being set by putClientData to understand in detail what this getClientData trying to do
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2020 10:28 AM
HI Vijay,
Did you find anything as how to use getClientData in server side?