GlideappVariablePoolQuestionSet() not working in scoped app
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 05:26 AM
Hi All.
I have created a scoped application and created a table which extends the task which is called SDCase. On this I have built few Record producers and created a formatter as well to display the variable section on the SDCase once it is created.
I have created a new record producer, where we select the SDcase(which only shows closed ones) on the form level, on selction of the SDcase it should automatically fill the form with the closed SDCase variable values.Now My requirement is how to fetch the variable values from a closed SDRequest and populate them on the form level variables. For this I'm using the below script include to fetch the values.
I'm able to fetch successfully in global application but I'm unable to fetch in my scoped application as Im using GlideappVariablePoolQuestionSet().
Script Include:
var Copy_exixsting_ritm = Class.create();
Copy_exixsting_ritm.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getRITMDetails: function() {
var ritm_number = this.getParameter('sysparm_ritm');
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(ritm_number);
set.load();
var vs = set.getFlatQuestions();
var object = {};
for (var i = 0; i < vs.size(); i++) {
if (vs.get(i).getLabel() != '' && vs.get(i).getValue() != '') {
object[vs.get(i).getName()] = vs.get(i).getValue();
object['dv_' + vs.get(i).getName()] = vs.get(i).getDisplayValue();
}
}
var data = JSON.stringify(object);
return data;
},
type: 'Copy_exixsting_ritm'
});
Can anyone please suggest a alternative for this.
Thank you in Advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2023 08:49 AM
@Nagashree5 You can create a script include in the global scope and try to perform the operation.
For more details you can refer to this blog this will help you to resolve the issue.
Please mark the answer correct/helpful based on Impact.
Regards,
RJ
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2023 10:38 PM
Hi @Rahul RJ ,
I have created the script include in the global application, but still the values are not getting retrieved from the SDCase table. Is this because it is a custom table?
Please suggest if there is any alternative.
Thank you in Advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2023 08:05 PM
@Nagashree5 you can add log statement in the script include and check it. It is executing or not then you need to grant the application cross scope access to access data of scoped table in global scope as script include is in global scope.
You can refer doc to create an Application cross-scope privilege
Please mark the answer correct/helpful based on Impact.
Regards,
RJ