How can we show assessment or survey in a popup view in our custom code for any of the table.

function promptForAssesment() {
    var assmtName = "Major Incident decline";
    var ga = new GlideAjax("AssessmentUtilsCustom");
    ga.addParam("sysparm_name", "getInstanceID");
    ga.addParam("sysparm_rec_id", g_form.getUniqueValue());
    //ga.addParam("sysparm_assmt_id", '8020ccbd931706106587bc3e1dba109d');
    ga.addParam("sysparm_assmt_name", assmtName);
    ga.getXMLAnswer(function(data) {
        data = JSON.parse(data);
        var asmtUiPage = "assessment_take2";
        var url = asmtUiPage + ".do";
        url += "?sysparm_assessable_sysid=" + data.asmt_Inst;
        url += "&sysparm_assessable_type=" + data.asmt_id;
        url += "&sysparm_hide_header=true";
        url += "&sysparm_hide_save=true";
        url += "&sysparm_hide_cancel=true";
        url += "&sysparm_hide_source_details=true";
        url += "&sysparm_stack=no";
        url += "&sysparm_return_url=/nav_to.do?uri=incident.do?sys_id=" + g_form.getUniqueValue();

        var dialogWindow = new GlideModal("", false, "modal-lg");
        dialogWindow.setTitle("Assessment Demote Major Incident");
        dialogWindow.setAutoFullHeight(true);
        //dialogWindow.setPreference("sysId", changeRequestSysId);
        dialogWindow.setPreference("focusTrap", true);
        //dialogWindow.on("beforeclose", this.deleteAsmt.bind(this, asmtInstanceSysId));
        dialogWindow.renderIframe(url, function() {
            $j("iframe[src*='" + asmtUiPage + ".do']").contents().find("td[class='spacerCellSmall']").each(
                function(i, e) {
                    e.remove();
                }
            );
        });
    });

}

Total Views: 1295

No responses yet

Leave a Reply

Your email address will not be published. Required fields are marked *