Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

GlideDialogForm objt is not working

APV Babu 06-11
Tera Contributor

Hello,

 

 

I have an requirement need to open a glide window on click ui action actually below code is working before one week now it's not working need a help..

 

 

function onRequest() {
    //Get the table name and sys_id of the record.
    var plan = g_form.getValue('plan_s');
    var lead = g_form.getValue('lead_cons');
    var request = g_form.getValue('request_action');
    var info = g_form.getUniqueValue();
    //var tableName = "x_trer2_rps_tech_erit_task.do?sys_id=-1&sysparm_query=" + '^parent_intake=' + info;
    var tableName = "x_trer2_rps_tech_erit_task.do?sys_id=-1&sysparm_view=adjustment_task&sysparm_view_forced=true&sysparm_query=" + '^request_action=' + request + '^plan_s=' + plan + '^parent_intake=' + info + '^lead_consultant=' + lead + '^';
    //var sysID = -1;

    //Create and open the dialog form
    var dialog = new GlideDialogForm('Create Adjustment Task', 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', 'adjustment_task'); //Specify a form view
    dialog.setLoadCallback(function(iframeDoc) {
        // To get the iframe: document.defaultView in non-IE, document.parentWindow in IE
        var dialogFrame = 'adjustment_task' in iframeDoc ? iframeDoc.adjustment_task : iframeDoc.parentWindow;
        //dialogFrame.g_form.setValue('parent_intake', info);
        //dialogFrame = '';

    });
    dialog.render(); //Open the dialog

}
 
 
Thanks in advance!!
 
APV Babu
6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@APV Babu 06-11 

so did something change with respect to form?

Any browser console error when button is clicked?

all these 3 fields are there on form?

var plan = g_form.getValue('plan_s');
    var lead = g_form.getValue('lead_cons');
    var request = g_form.getValue('request_action');
Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Yes all fields are there

@APV Babu 06-11 

any browser console error when button is clicked?

what debugging have you done so far?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I have tested with alerts I thought inside call back function is not working