- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2020 09:44 PM
Hi Team,
I am facing below Issue
I have requirement to copy all the worknotes from HR Case to HR Task and vice versa.
While this is working using journel entry(-1), but every time a worknote is added to the HR Case all the old worknotes in HR Case are getting copied to HR Case also.
kindly suggest
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 01:40 AM
Hi Tahzeeb,
I have tried a mock up on my PDI and is working as expected. I have attached my design. Can you give it a try and let me know if you have any questions/issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2020 10:47 PM
For After BR
var HRTask = new GlideRecord('HR_task');
HRTask.addQuery('parent', current.sys_id);
HRTask.query();
while(HRTask.next())
{
HRTask.work_notes = current.work_notes.getJournalEntry(1);
HRTask.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2020 11:03 PM
1. I hope you have written GlideRecord on "sn_hr_core_task" and not "HR_task" in the above script
2. Open the BR "Validate Changes" on "sn_hr_core_task" table and comment these two lines. It will stop the rollback of work notes of HR case from being copied from HR task back into HR case
The sys_id of this BR OOTB is fa5330019f22120047a2d126c42e70f9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2020 11:18 PM
Hi shruthiub,
This approach has worked but now no worknotes from HR Task are getting copied to HR Case, while as in my case I need to get the worknotes copied from HR Task to HR Case as well
Yes the GlideRecord form is sn_hr_core_task
Please suggest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 12:27 AM
Hi Tahzeeb,
Can you confirm the requirement? I can help you out with this.
1. On insert of a HR task, you want the entire work notes of HR case to be copied to HR task
2. When HR Case is updated with a new work notes, you want this new work notes to be copied to HR Task
3. When HR Task is updated with a new work notes, you want this new work notes to be copied to HR Case
2 and 3 should not lead to a loop.
Is that correct? The above requirement is achievable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2020 12:31 AM
Yes, this correct. that is what is the requirement