Stop reload of form after submitting from glidedialog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2011 10:29 AM
I have a UI action on a custom form using the code below:
function createCandidate(){
//Get the table name and sys_id of the record
var tableName = "u_hrpo_candidates";
//var sysID = g_form.getUniqueValue();
//Create and open the dialog form
var dialog = new GlideDialogForm('Create Candidate', tableName); //Provide dialog title and table name
dialog.setSysID(-1); //Pass in sys_id to edit existing record, -1 to create new record
dialog.addParm('sysparm_view', 'default'); //Specify a form view
dialog.addParm('sysparm_form_only', 'true'); //Add or remove related lists
dialog.render(); //Open the dialog
}
This pops up a view of another table to let them create a new candidate if they candidate they want isnt in the list yet. The rub is that when they hit submit on the dialog window it refreshes the original form (which may have unsaved data). Is there something I can add to this that will stop that last form reload after they submit off the dialog?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2011 12:28 PM
I am doing something similar to you with the popup dialog, but I look for any changes to the form at the beginning of the UI Action function:
// check for any unsaved changes first
if(g_form.modified){
answer = confirm("Values on the form have changed.\nAre you sure you want to proceed without saving this record first?");
if (answer == false) {
return false;
}
}
Not exactly what you are looking for, but might be a good alternative.