Attempts to close the 'Request Permission' task in Change Requewithout filling out risk assessment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 08:21 PM
Hi all,
I need inputs to achieve the below requirement,
I opened the change task 'Request Permission' and attempt to close the task,
1. I am prompted with the message 'Please complete the Risk Assessment questionnaire' and there is a hyperlink to the risk assessment behind words 'Risk Assessment'
2. If I click on the hyperlink, I am being redirected to the 'Risk Assessment' (updates to the change are not saved in the background) and a popup window with "risk assessment"quessionnaire shouldopen on the change task
Thanks in advance for the help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 08:31 PM
HI @Sahasra ,
I trust you are doing great.
You can write client script on change task form :
(function() {
// Add an 'onClose' function to the client script to trigger when closing the task
function onClose() {
var riskAssessmentCompleted = g_form.getValue('risk_assessment_completed'); // Assuming there's a field indicating if the assessment is completed
if (!riskAssessmentCompleted) {
if (confirm('Please complete the Risk Assessment questionnaire. Click OK to open it.')) {
var riskAssessmentLink = g_form.getControl('risk_assessment_link').value; // Assuming 'risk_assessment_link' is the field holding the hyperlink
window.open(riskAssessmentLink, '_blank');
}
return false; // Prevents the task from closing
}
return true; // Allow closing if assessment completed
}
// Register the onClose function to run when closing the task
g_form.registerOnSubmit(onClose);
})();
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 09:00 PM
Hi Amit, Thanks for the immediate reply,
My requirement is how can we put ui action in the pop-up message "'Please complete the Risk Assessment questionnaire "In this message the Risk Assessment is a ui action with hyperlink.