- 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-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-04-2023 07:40 AM
Good to see that your issue resolved, happy to help. 😊
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-04-2023 07:54 AM - edited 11-04-2023 07:54 AM
Yes @AshishKM Appreciate for your help
Its helped my requirement
Thankyou.