Hide variable on multi row variable set

KaMmILa__
Tera Expert

I have a Multi-row variable set which I am using in a catalog item , how to hide a variable on that , I am not able to hide the Variable Using UI policy as the visible is grayed out

 

find_real_file.pngI also created a onload cS still not working 

find_real_file.png

1 ACCEPTED SOLUTION

Harsh Vardhan
Giga Patron

Eg: I have location reference variable on my MRVS then I added location table to match it .

Quick Demo

 

 

find_real_file.png

 

Hope it will help you. 

View solution in original post

23 REPLIES 23

A challenge!

So, where are you going to use this item; in the catalog, or in the system UI?

I might have a trick or two yet to play. 

 

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

the variable set is used in the catalog item and when we create the request then the variables should show in the RITM,, this is where we are reporting 

Sorry - I meant, where will users order this item, in the Portal or in the UI?

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

Ok, I'll admit defeat as far as the Service Portal goes, but in the UI you could do the following: 

Add this function to your onload (the one I specified earlier) - this has to be defined outside of the actual onload function so paste it below the close brackets.

Inside the original onload script, add a call for process(); to hide the variable in the header onload. 

Update the vset variable to be the sys_id of your variable set. 

function process() {
    setTimeout(function() {
        var vset = 'f0ce3f2b07b1a010c5cff1e08c1ed045'; //change this to the sys_id of your MRVS



        var eles = g_form.getControl(vset + '_table').children[1].children;

        for (var i = 0; i <= eles.length -1; i++) {
            if(eles[i].children != undefined)
            var child = eles[i].children;
            var last = child.length - 1;
            child[last].style.display = 'none';
        }

        var header = g_form.getControl(vset + '_table').children[0].children;

        for (var a = 0; a <= header.length -1; a++) {
            if(header[a].children != undefined)
            var child1 = header[a].children;
            var last1 = child1.length - 1;
            child1[last1].style.display = 'none';
        }



    }, 500);
}

 

Next, make a Submit client-script inside the MVRS. This one will need to have isolated script set to false as well.

 

function onSubmit() {

	window.parent.process();
   
}

Service Portal this is somewhat more difficult to script. I realize you might have given up on this already but what can I say, I like a challenge. 

I hope this helps!

If this was helpful or correct, please be kind and remember to click appropriately!

Michael Jones - Proud member of the CloudPires team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

Thank you so much for your time 

Please correct me if I miss understanding this 

Created the onload client script inside the MRVS and also create the onsubmit client script

find_real_file.png