Set the variables from GlideappVariablePoolQuestionSet

Nagashree5
Tera Contributor

Hi All,

 

There is a field called "Closed RITM"(it shows only inactive RITM's specific to the catalog), once a RITM is selected here, the variables from the closed RITM needs to be populated as the variable values on the form. 

For this, I'm using GlideappVariablePoolQuestionSet() to retrieve the variable values, and I have written the script include which is retrieving the variable values, but now Can any body please help in setting the values of these variables on the form level. How can I do this?

 

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;
},
Copy_exixsting_ritm'
});

 

Thank you in Advance.

0 REPLIES 0