How to display a pop-up confirmation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I want to Display a pop-up confirmation with YES or NO when the HR Service is ‘Hire’ and state changes to close complete without using a UI Action in Workspace. Please help me here.
@Ankur Bawiskar
@Ravi Gaurav
@Jaspal Singh4
@Ravi Chandra_K
@Dr Atul G- LNG
@Mohith Devatte
@hvrdhn88
@Mohith Devatte
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Harsha38 ,
Use g_modal.confirm() to create the Yes/No dialog and g_form.submitted = false within the rejection function to stop submission
Refer: g_modal ( Next Experience ) - Client
Sample code for UI action:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Try this script once,
function onUIActionClick() {
var state = g_form.getValue("state");
var hrService = g_form.getValue("hr_service");
var closeCompleteState = '3';
var hireServiceSysId = 'UR_HireService_SYS_ID';
if (state == closeCompleteState && hrService == hireServiceSysId) {
if (g_form.submitted) return false;
g_modal.confirm('Confirmation', 'Are you sure you want to close this Hire case?', {
confirmTitle: 'Yes',
cancelTitle: 'No'
}).then(function () {
g_form.submitted = true;
g_form.submit('save');
}, function () {
g_form.submitted = false;
});
return false;
}
}Best Regards,
Dinesh.
