- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2020 10:24 AM
I am using below script to update the demand description field...
var gr = new GlideRecord('test_demand');
if (gr.get('b6a1c42cdb578c503b0cf5261d96196c')){
gr.setValue('long_desc', ' .... . .. . . . ');
gr.update();
gs.print('updated!');
}
else {
gs.print('nothing updated,..');
}
in the long description, i want to put the below text in same format.
"> this is the
description ...
and it should not be changed"
To get that I am using + and \n in the end of 1st and 2nd line and + in the starting of 2nd and 3rd... but it seems to be not working. is there any easy way/function to modify it... ? Please suggest...
Thanks in advance....
Solved! Go to Solution.
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2020 11:06 AM
Hi
Please try the snippet below in your background script, it should work.
var gr = new GlideRecord('test_demand');
if (gr.get('b6a1c42cdb578c503b0cf5261d96196c')){
gr.setValue('long_desc', "> this is the\n"+
"\n"+
"description ...\n"+
" and it should not be changed");
gr.update();
gs.info('updated!');
}
else {
gs.info('nothing updated,..');
}
Thanks & Regards,
Rishabh Jha
Aavenir (http://www.aavenir.com/)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2020 11:06 AM
Hi
Please try the snippet below in your background script, it should work.
var gr = new GlideRecord('test_demand');
if (gr.get('b6a1c42cdb578c503b0cf5261d96196c')){
gr.setValue('long_desc', "> this is the\n"+
"\n"+
"description ...\n"+
" and it should not be changed");
gr.update();
gs.info('updated!');
}
else {
gs.info('nothing updated,..');
}
Thanks & Regards,
Rishabh Jha
Aavenir (http://www.aavenir.com/)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2020 11:31 AM
It works well...
Thanks.... Rishabh.