Avoid Field Service to create default Work Order task with same name as work order if no template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 08:55 AM
Hi Community,
I am observing a situation with Field Service Management module. My scenario is pretty simple
- Creating a work order without any template.
- Changing state to Ready for Dispatch. (Note: I am not using Qualification)
- WO state changes to Ready for Dispatch and automatically a work order task is created with same name as workorder. (Note: Behavior is same with the Awaiting Qualification state)
I am looking for the approach to avoid the creation of that task, because I have a business rule running which will create the required tasks based on certain conditions.
BR/Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2024 09:47 AM
Hi @RahulP030357301 ,
plz update BR as
(function executeRule(current, previous /*null when async*/) {
// Add a condition to check if no template is used
if (current.template_used.nil() || current.template_used == false) {
return; // Skip task creation
}
// Existing logic for task creation
var taskGr = new GlideRecord('sn_customerservice_work_order_task');
taskGr.initialize();
taskGr.short_description = current.short_description;
taskGr.work_order = current.sys_id;
taskGr.insert();
})(current, previous);
Thanks
Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 07:21 AM
Hi Arun,
Thank you for your response.
Will you please provide more detail, which BR are you mentioning?
Regards,
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2024 10:09 PM
Hi Gurus,
Can anyone else share some more view, how can we achieve this?
BR/Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 09:57 AM - edited 07-29-2024 09:58 AM
thinking out loud.
why not change it to request-driven instead of task-driven? i believe it won't create a subtask when creating a work order. and for your work order tasks, you can run your BR on insert. could it work?