How to create a confirmation box that changes the state of a form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 04:28 AM
Hi Everyone,
i wish to create a confirmation box on submission of a form that asks if you wish to change the state of the parent case to work in progress.
it should simply ask 'do you want to resume the case' with two options yes or no, if i select yes the parent case of that form should change it's state to work in progress, and if i select no then nothing should happen and it should simply submit the form.
Does anyone know how do i achieve this?
Thanks,
kartikey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 04:35 AM
@kartikey Please refer the below link for reference only:
Kindly change according to your requirement.
Please mark this as helpful and accept it as a solution if this resolves your query.
Thanks,
Sujatha V.M.
Sujatha V.M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 05:30 AM
Can this be achieved without a UI action?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 04:58 AM
Hi @kartikey ,
Create a UI action with glideModel api , use the below code logic to build your code for this requirement.
function confirmDialog(){
var gm = new GlideModal('confirm');
//Sets the dialog title
gm.setTitle('Confirmation');
//Set up valid custom HTML to be displayed
gm.renderWithContent('\
<div style="padding:15px"><p>Confirm?</p>\
<div style="padding:5px;float:right">\
<button style="padding:5px;margin-right:10px" \
onclick="window.takeAction(this.innerHTML)" \
class="btn btn-default">No</button>\
<button style="padding:5px" \
onclick="window.takeAction(this.innerHTML)" \
class="btn btn-primary">Yes</button>\
</div> \
</div>');
//We'll use the windows object to ensure our code is accessible from the modal dialog
window.takeAction = function(thisButton){
//Close the glide modal dialog window when either button is pressed.
gm.destroy();
//perform the appropriate action on the client.
if(thisButton=='Yes'){
alert("You pressed 'Yes'");
} else if(thisButton=='No') {
alert("You pressed 'No'");
}
};
return false;//prevents the form from submitting when the dialog first loads
}
Ref : Click here
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 05:28 AM
Hi, can this be done without a UI action?