- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 11:49 PM
I have defined the inputs in custom action as -
And run script as -
But it is not updating the sc_request
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 11:42 AM
You code has a small Error and you code must be something like below
(function execute(inputs, outputs) {
var gr=new GlideRecord('sc_request');
gr.addQuery('sys_id',inputs.request);
gr.query();
if(gr.next())
{
gr.short_description = inputs.shortdescription;
gr.update();
}
})(inputs, outputs);
Please Mark my answer as correct if that helps.....
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 10:21 AM
Hi @shalikasurbhi1 ,
You have quotes around 'inputs.request' in your run script line: gr.addQuery('sys_id','inputs.request');
The quotes are making it a string value. Remove the quotes to use the variable value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 11:42 AM
You code has a small Error and you code must be something like below
(function execute(inputs, outputs) {
var gr=new GlideRecord('sc_request');
gr.addQuery('sys_id',inputs.request);
gr.query();
if(gr.next())
{
gr.short_description = inputs.shortdescription;
gr.update();
}
})(inputs, outputs);
Please Mark my answer as correct if that helps.....
Thanks.