GlideDialogForm and GlideDialogWindow in UI Action

Brian Lancaster
Tera Sage

Our initial vendor gave us a UI action to mark incidents as duplicate.  Below is the code and they are using GlideDialogForm and GlideDialogWindow.  I noticed that the dialog box that opens to select an incident that the current incident is a duplicate of has a delete button.  This appears for users who do not have delete wrights on the incident table and allows them to delete the record.  Is there a way around this?  I did not find any documentation on GlideDialogForm.

function showMyForm() {

    var con = confirm("Do you really want to mark this Incident Duplicate ?");
    if (con == true) {
        //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('Select the parent 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', 'Default view'); //Specify a form view
        // 		dialog.addParm('sysparm_form_only', 'true'); //Add or remove related lists
        // 		dialog.render(); //Open the dialog
        //Title for the browser window not the ui page title
        var gdw = new GlideDialogWindow('Mark Duplicate Page');
        gdw.setTitle('Select the parent Incident');
        gdw.setSize(750, 300); //Size of the popup window
        //		gdw.addParm('sysparm_view', 'default');
        gdw.setPreference('sysid', sysid);
        gdw.render();
    } else
        return false;
}
1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hi,

From my understanding, GlideDialogForm and GlideModalForm are ways to display a database record in it's entirety (not a UI Page with specific display elements, etc.), whereas GlideDialogWindow and GlideModal is used to interact in a smaller capacity (with the GlideModal API replacing GlideDialog) as in a UI Page that's called.

So, with that said, I don't think GlideDialogForm should have been used at all in your scenario.

It is interesting to hear that they have access to "Delete", although I'm unsure how extensively you tested this to verify, etc., but either way, you may have to re-write this to use GlideModal.

Some "documentation" here for GlideDialogForm: https://snprotips.com/undocumented-servicenow-apis (scroll down some to see it).

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

5 REPLIES 5

Allen Andreas
Administrator
Administrator

Hi,

From my understanding, GlideDialogForm and GlideModalForm are ways to display a database record in it's entirety (not a UI Page with specific display elements, etc.), whereas GlideDialogWindow and GlideModal is used to interact in a smaller capacity (with the GlideModal API replacing GlideDialog) as in a UI Page that's called.

So, with that said, I don't think GlideDialogForm should have been used at all in your scenario.

It is interesting to hear that they have access to "Delete", although I'm unsure how extensively you tested this to verify, etc., but either way, you may have to re-write this to use GlideModal.

Some "documentation" here for GlideDialogForm: https://snprotips.com/undocumented-servicenow-apis (scroll down some to see it).

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

I tested it by impersonating a user who just had ITIL.  However after converting it to GlideModal it still showed the delete button.  That appears to be in the UI Page they setup so I will have to comment that out.  I have never had to undo so much work that a ServiceNow Partner has done.

Hi,

Haha...and also...while that's not really funny, it does happen.

You're a smart lad though so your company is very fortunate to have you.

I remember before I started working with a partner directly, we had a partner come in to help with an implementation (my boss had already signed all the papers before I came onboard) and so I was always pushing for that partner to do the least amount of code...because I knew when they left, they'd hand the keys, and be gone.

Some do really great work, some don't.

You don't find out some of these wonky things until after they get paid and the surveys are submitted.

So...PSA to other companies out there...don't rely solely on the partner to do it all, you need to have appropriate staff in-house to help monitor or help review the code as it's being promoted...or at the very least, appropriate staff who can spot the issues and fix them.

Not saying don't use a partner, of course, that's one of the best options if you can't do it all in-house, but read reviews, and review multiple partners if you can before you make a decision.

Today, now that I'm with a partner, I involve myself as the Principal Architect in nearly all projects and training has been given on best practices, etc. I also lead the entire SN Practice Area and we don't stop after the job is done. Our customers can always contact us and we'll help give guidance, etc. Not all partners are the same.

-Allen

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Unfortunately before I started the had also signed a contact and purchased what the partner called the "Golden Template" but it was more like the Golden Shame.