UI Actions FSM (Start Travel Start Work, Close Complete on wm_task) are not working in Worksapce
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2023 12:07 AM - edited 11-12-2023 12:08 AM
Hi All OOTB ui action of FSM is working fine in native view but not working in configurable workspace view
Can any one guide any script or what I am missing on it
please refer this link: https://your instance/ sys_ui_action.do?sys_id=933bdef31b03200050fdfbcd2c071365&sysparm_record_target=sys_ui_action&sysparm...
or
Please check below OOTB ui action script
Please guide me with script
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2023 03:58 AM
Can you try this by adding it in Workspace client script section. what does this dialog box do "sm_open_task_upstream_work" in native side ?
function onClick(g_form) {
var gajax = new GlideAjax("SMTaskDependency");
gajax.addParam("sysparm_name", "checkUpstreamTasks");
gajax.addParam("state_flow_id", "b48e00ead7201100158ba6859e6103c7");
gajax.addParam("sysparm_uuid", g_form.getUniqueValue());
gajax.getXMLAnswer(ajaxResponse);
function ajaxResponse(response) {
if (response == 'true')
showDialogWork();
else {
g_form.submit('start_work');
var ajax = new GlideAjax('GeolocationAJAX');
ajax.addParam('sysparm_name', 'checkTracking');
ajax.addParam('sysparm_usersysid', g_user.userID);
ajax.getXML(function(response) {
var isUserTracked = response.responseXML.documentElement.getAttribute("answer");
var result = isUserTracked.split(',');
if (result[0] == 'true') {
navigator.geolocation.getCurrentPosition(
function(position) {
var ajax = new GlideAjax('GeolocationAJAX');
ajax.addParam('sysparm_name', 'storeGeolocationHistory');
ajax.addParam('sysparm_usersysid', g_user.userID);
ajax.addParam('sysparm_latitude', position.coords.latitude);
ajax.addParam('sysparm_longitude', position.coords.longitude);
ajax.addParam('sysparm_action', 'Start Work');
ajax.addParam('sysparm_task', g_form.getUniqueValue());
ajax.getXML();
});
}
});
}
}
function showDialogWork() {
g_modal.showFields({
title: "Are you sure?",
fields: [{
type: 'fieldType',
name: 'fieldName',
label: 'YourField',
mandatory: 'true'
}],
instruction: 'This action can\'t be undone.',
size: 'md',
cancelTitle: "Not now",
confirmTitle: 'Start work',
cancelType: "default",
confirmType: 'confirm'
}).then(function() {
g_form.submit('start_work');
});
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2023 04:50 AM
Hi @Dibyaratnam
Dialog box will start work in word order task and calculate the duration
This is pop up I am getting
But there is no check box to proceed
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2023 06:25 AM - edited 11-12-2023 06:27 AM
Can you share the screenshot and let me what exact calculation it's doing. Is there any field on the dialog box. That logic needs to be added.
Also if you see this section
g_modal.showFields({
title: "Are you sure?",
fields: [{
type: 'fieldType',
name: 'fieldName',
label: 'YourField',
mandatory: 'true'
}],
Here you can pass fields as per your requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2023 09:14 PM
Hi @Dibyaratnam
The moment we click on start work (ui action)
Below tab wil start calculating(native Ui)
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2023 09:23 PM
And how these fields are used. What's the purpose. Accordingly you can create this modal by using g_modal as I have pasted in the previous replies.