UI Action is not working on form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 03:15 PM - edited 12-05-2023 03:31 PM
UI Action is not working on the task table where we are doing gliderecord on the change table as the reference field(assessment_instance) and gliderecord on the assessment table as we need to get the data.
When I remove the glide record lines then we click on UI Action it is working and getting popup but data is not displaying
Please guide me to resolve the issue.
Thanks in Advance.
UI Action :
function showResponse() {
var id = g_form.getUniqueValue();
var type = g_form.getValue('metric_type');
var a = g_form.getValue('number');
var inc = new GlideRecord("change_table");//change table
inc.addQuery("name", "CONTAINS", a);
inc.query();
while (inc.next()) {
var b = inc.getValue("assessment_instance");
}
var ass = new GlideRecord("assessment");
ass.addQuery("number", b);
ass.query();
while (ass.next()) {
var c = ass.getValue("sys_id");
}
var url = 'assessment_take.do?sysparm_assessable_sysid=' + b + '&sysparm_assessable_type=' + type + '&sysparm_reader_view=true';
var d = new GlideOverlay({
title: getMessage("User's Response"),
iframe: url,
width: '80%',
height: '100%',
onAfterLoad: function() {
var iframe = d.getIFrameElement();
setTimeout(function() {
iframe.height = parseInt(iframe.height) + 1;
}, 0);
}
});
d.render();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 04:20 PM
Is change_table a table? Do you need change_request there instead.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 04:35 PM
Change table is a table name its a correct table name

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 04:40 PM
Ok.. I am going to make few improvements to your script although I dont understand the intent here.
function showResponse() {
var id = g_form.getUniqueValue();
var type = g_form.getValue('metric_type');
var a = g_form.getValue('number');
var b = '';
var c = '';
var inc = new GlideRecord("change_table");//change table
inc.addQuery("name", "CONTAINS", a);
inc.query();
if (inc.next()) {
b = inc.getValue("assessment_instance");
var ass = new GlideRecord("assessment");
ass.addQuery("number", b);
ass.query();
while (ass.next()) {
c = ass.getValue("sys_id");
}
}
var url = 'assessment_take.do?sysparm_assessable_sysid=' + b + '&sysparm_assessable_type=' + type + '&sysparm_reader_view=true';
var d = new GlideOverlay({
title: getMessage("User's Response"),
iframe: url,
width: '80%',
height: '100%',
onAfterLoad: function() {
var iframe = d.getIFrameElement();
setTimeout(function() {
iframe.height = parseInt(iframe.height) + 1;
}, 0);
}
});
d.render();
}
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 08:53 PM
I have tried with above code but it's not working