Multi Row Variable Set Reference variables

SaiBhargav1
Kilo Contributor

Hi all,

I have requirement on service catalogs , i used multirow variable set . Requirement

as part of my requirement i have created two Multi row variable sets 

1st variable set variable are Asset id (reference asset table) , SAP number

2nd variable set variables are Asset id(reference asset table) , asset found

 

1st variable set is for end user 2nd is for task person.

 

in the 1st variable set user selected the two items and submitted the request , then task person in the 2nd variable set once click the asset id in that it should display what are the assets were selected by end user.  how to restrict that if any one knows let me know.

1st variable set here 2 assets selected

find_real_file.png

2n variable set once click on asset id it should show only those 2 assets but it's showing all the assets. how to restrict that let me know.

find_real_file.png

find_real_file.pngthanks in advance.

12 REPLIES 12

Harsh Vardhan
Giga Patron

just confirming here, asset id is reference field ? 

if yes then you can set the advance reference qualifier on it to restrict the list of records based on the users. 

Yes it is a reference variable. 

did you try with reference qualifier ? paste the code which you have added 

Script include:

========

 

var mrvsAssetID = Class.create();
mrvsAssetID.prototype = Object.extendsObject(AbstractAjaxProcessor, {

lostAssetID : function () {

var aid = this.getParameter("sysparm_assetid");

var mrvs = current.asset_details; // multorow name
var rowCount = mrvs.getRowCount();
for (var i=0; i<rowCount; i++){

var row = mrvs.getRow(i);

var gr = new GlideRecord("sc_req_item");
gr.addQuery("sys_id" , aid);
gr.query();
gs.log(ast.sys_id , "sai lost process" );
while(gr.next()){
var json = new JSON();
var object = {

"lostassetid" : row.asset_id,
};
var data = json.encode(object);
gs.log(data , "object");
return data;

}
}



},

type: 'mrvsAssetID'
});

 

and in the reference qualifier i have given this  script include name and function name
javascript:mrvsAssetID().lostAssetID();