- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2017 07:30 AM
Hi,
On our catalog tasks there is a 'close task' UI Action. When this is selected we require that a popup box appears with the message:
'Are you sure you want to complete this task?'
with a yes/no option.
If yes selected the UI action continues to run.
If no UI Action does not run and returns you to the task.
I believe that the script in the 'close task' UI action can be modified to achieve this, I'm just not sure on what script I need to use?
Any help is greatly appreciated.
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2017 08:46 AM
I can see you have an additional braces at the end of the code '}' (line 17). Can you move it above the if condition which will correctly close the function closeTask().
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2017 07:32 AM
Hi Sam,
You can add this code in your UI Action, The UI action should have code that runs on client side.
var check = confirm("'Are you sure you want to complete this task?");
if(check){
alert("I confirm"); // Execute your client code here
}
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2017 07:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2017 08:00 AM
Can you remove the code in line 4 ? function closeTask(). The function does not exist in UI Action and you are already setting the state value to 3 and closing it.
Please try and let me know
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2017 08:07 AM
Also I think you have duplicated the code to close task by including server side logic. I believe this code is enough for task closure.
var check = confirm("'Are you sure you want to complete this task?");
if(check){
alert("I confirm"); // Execute your client code here
g_form.setValue('state', 3);
gsftSubmit(null, g_form.getFormElement(), 'close_sc_task');
}
Note: code may have typos