- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2018 04:14 AM
Hello,
through a System Import Set, I want to upload the sys_journal_field records for work notes on an Asset record (alm_hardware). Target: sys_journal_field.
Within the Transform Map, I set up a Transform Script with the When condition OnBefore. It just contains:
target.autoSysFields(false);
Further, I added two Field Maps targeting sys_created_by with script:
answer = (function transformEntry(source) {
mycreatedBy = source.u_created_by;
var createdBy = '';
var get_user=new GlideRecord('sys_user');
get_user.addQuery('u_te_id',mycreatedBy);
get_user.setLimit(1);
get_user.query();
while(get_user.next()){
createdBy = get_user.sys_id;
}
return createdBy; // return the value to be put into the target field
})(source);
and sys_created_on with script:
answer = (function transformEntry(source) {
timestamp = source.u_datum;
// Add your code here
return timestamp; // return the value to be put into the target field
})(source);
I just use the script there as I debugged the script for the date format.
My sys_journal_field records are looking as beautiful as they can:
However, within the alm_hardware records, they show my account and the time the record was created and not the one as I loaded it.
Any idea why not the person and the date are showing up as it is showing within the sys_journal_field records?
Thanks in advance
Jan
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2018 04:45 AM
There are multiple tables that control the journal entries like audit, history and the journal.
You can refer this post from SN Guru to see on how you could update entries in the journals.
https://www.servicenowguru.com/system-definition/remove-activity-log-journal-entries/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2018 04:45 AM
There are multiple tables that control the journal entries like audit, history and the journal.
You can refer this post from SN Guru to see on how you could update entries in the journals.
https://www.servicenowguru.com/system-definition/remove-activity-log-journal-entries/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2018 06:10 AM
Ok. Now I understand. thought for import purposes that there is a less risky approach available. However, I can derive the necessary actions from this article. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2019 05:53 AM
Any luck with this. I am have the same issue when doing an XML import