GlideDialogForm - Warning on Save

kristenankeny
Tera Guru

We have a custom form layout that contains only the fields relevant to resolving an incident. I have created a UI Action that brings up this form:

function showMyForm(){

      //Get the table name and sys_id of the record

      var tableName = g_form.getTableName();

      var sysID = g_form.getUniqueValue();

      //Create and open the dialog form

      var dialog = new GlideDialogForm('Resolve incident', tableName); //Provide dialog title and table name

      dialog.setSysID(sysID); //Pass in sys_id to edit existing record, -1 to create new record

      dialog.addParm('sysparm_view', 'ResolveDialog'); //Specify a form view

      dialog.addParm('sysparm_form_only', 'true'); //Add or remove related lists

      dialog.render(); //Open the dialog

}

This is the form that pops up and they have to populate the close code and notes:

find_real_file.png

But, when you click "Update", you get this warning:

find_real_file.png

If I click "Leave" it closes the dialog completely and refreshes the incident record. If I click "Stay", it closes the dialog completely and the incident record shows the blue change icon next to the fields that I changed via the dialog form. How can I resolve this issue?

1 ACCEPTED SOLUTION

It looks like GlideDialogForm has been replaced with GlideModalForm - GlideModalFormV3 - Client


View solution in original post

11 REPLIES 11

harishdasari
Tera Guru

Hi Kristen,



UI Action code:


if(current.isValidRecord()) {


    current.update();


} else {


    current.insert();


}



action.setRedirectURL('render_rtsdwidgets_eventsaved.do');



The in setRedirectURL, you'll need to create a UI Page.



UI Page client script code:


window.opener.location.reload();


window.close();



Now after hitting save on my form that pops up in a new window, it quickly redirects to that UI Page, which closes itself and reloads the parent window!




Thanks


Hi Harish,



Thanks for the suggestion - unfortunately I'm still getting the warning about leaving the page. This is how I set it up:



find_real_file.png



find_real_file.png


harishdasari
Tera Guru

Hello Chuck,


Could you please help Kristen.



ctomasi



Thank you


Thanks for the mention. Unfortunately I have nothing to add at this time. Sorry.