Need to add a hand icon on the Work Order task Panel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Here is the requirement -
Allow Dispatchers to Claim Work Order TasksProvide dispatchers with the ability to visually claim a Work Order Task within Dispatcher Workspace.
Dispatchers shall be able to claim an unclaimed Work Order Task.
The system shall provide a visual indicator distinguishing claimed and unclaimed Work Order Tasks.
- Unclaimed: use a ‘Green Hand’ icon by the dispatch
- Claimed: Define the same icon in a different color
Claimed status shall be visible to all dispatchers viewing Dispatcher Workspace
The solution shall reduce duplicate dispatcher effort by identifying claimed tasks before assignment. (eliminate the issue with multiple dispatchers picking up the work at the same time)
Below are the steps i am trying -
Created Two custom fields - on wm_task table and added these fields to Dispatcher Workspace Task Card
Is Claimed (u_is_claimed) — Type: True/False (Default: false)
Claimed By (u_claimed_by) — Type: Reference (sys_user)
Workspace Declarative Action ("Claim Task" Button) - here is the script
var targetSysId = current.sys_id || (input ? (input.sys_id || input.sysIds) : null);
if (targetSysId) {
var wot = new GlideRecord('wm_task');
if (wot.get(targetSysId)) {
// Double-check real-time database state to handle race conditions
if (wot.u_is_claimed == true || !gs.nil(wot.u_claimed_by)) {
gs.addErrorMessage('This task has already been claimed by ' + wot.u_claimed_by.getDisplayValue() + '.');
} else {
wot.setValue('u_claimed_by', gs.getUserID());
wot.setValue('u_is_claimed', true);
wot.update();
gs.addInfoMessage('Task successfully claimed.');
}
}
}
Not sure about how to add green hand and blue icons to task panel . Appreciate the help. Tried field decorators but it shows only the existing icons