- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2021 01:45 AM
Hi , Try this in your UI Action code
function saveDesc() {
var desc = g_form.getValue('description');
g_form.setValue('description', desc);
gsftSubmit(null, g_form.getFormElement(), 'save_dec');
}
if(typeof window == 'undefined')
runBusRuleCode();
//Server-side function
function runBusRuleCode(){
current.update();
gs.addInfoMessage('You did it!'); //testing
action.setRedirectURL(current);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2021 02:02 AM
You should verify if any of the values in form are modified or not, if yes then clear the value.
check below links
https://servicenowguru.com/scripting/business-rules-scripting/checking-modified-fields-script/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2021 10:35 PM
I got the solution,
Instead looking for client side solution we can do it via server scripting via GlideRecord.
current.update is updating all the fields. so using below code we can get the solution.
var gr = new GlideRecord('incident');
gr.addQuery('sys_id',current.sys_id);
gr.query();
while(gr.next()) {
gr.description = current.description;
gr.update();
}
action.setRedirectURL(current);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2022 06:15 AM
this is not working with Additional Comments (Journal Input) type field on my form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-30-2022 06:16 AM
I want to update Additional Comments field only with current additional comments field value