- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2017 01:21 PM
Hi all,
we have a custom table with few fields. Requirement is to the change one of the String fields (say Review comment u_review_comments) to a Journal input field to track changes to this field. I created a new Journal_input field. Its working fine. Now, i need to copy the values of Review Comment string field (max length=1000) to this new field u_review_comment . i wrote the following script and ran it in background scripts. Its not working. Any input is appreciated. I am in Helsinki patch 11.
var csi = new GlideRecord('XXX');
//csi.addQuery('u_number', 'CSI0001043');
csi.query();
while(csi.next()){
gs.print('count ' + csi.getRowCount());
var comment = csi.u_review_comments;
gs.print('comment ' + comment);
csi.u_review_comment = comment;
csi.update();
}
the rowcount and comment variable have data show data, the value is just not coming over to journal field meaning its not showing in activity. If i just pass a string like csi.u_review_comment = 'testing'; it works.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2017 01:37 PM
hi Ajit,
use the following :
var csi = new GlideRecord('XXX');
//csi.addQuery('u_number', 'CSI0001043');
csi.query();
while(csi.next()){
gs.print('count ' + csi.getRowCount());
var comment = csi.u_review_comments;
gs.print('comment ' + comment);
csi.u_review_comment.setJournalEntry(comments);
csi.update();
}
i have replaced csi.u_review_comment = comment; with csi.u_review_comment.setJournalEntry(comments);nts);
Please mark it as correct if helpful
Pk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-22-2017 02:59 PM
that worked. thanks a lot.