- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 09:13 AM
Hi All
I want to copy worknotes of workorder task (wm_task) to workorder worknotes (wm_order).
Please can guide and suggest me the script please
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2023 06:59 AM
Please add logs and check if process trigging.
Also add the current.update(); for [ testing only ], If its working means we need to update work_order record differently because current [ object ] belong to wm_task not the wm_order.
Use the below code in the BR and share the result.
var grWmOrder = New GlideRecord("wm_order");
grWmOrder.addQuery("sys_id",current.wm_order); // wm_order is reference field on wm_task
grWmOrder.query();
if(grWmOrder.next()){
grWmOrder.work_notes = current.work_notes; // update the work note from task to order
grWmOrder.update();
}
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2023 09:34 AM
Hi @Research
You can write business rule [update] on table ( wm_task ) with "When to run" condition for Work notes changes.
and write the below code in "Advaced" tab for copying the work notes from wm_task to associated wm_order record.
current.wm_order.work_notes = current.work_notes;
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 12:03 AM - edited 11-02-2023 12:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-02-2023 05:53 AM
Please test this BR and share the result or any further issue.
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2023 01:44 AM