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

I am getting this error message when trying to add the country 

find_real_file.png

Sorry, it was late.

The process function needs to be in an onload script, set as isolate script false, on your catalog item, rather than being in the MVRS itself. You could also call process inside the actual onload - so something like this in your item: 

function onLoad() {
    //call process to hide the last column in the mvrs onload
    process();
	
	//end of the onload function
}


    function process() {
		//Basically we are going to hide the last column and it's header in the display for the mvrs
		//Timeout is to let other events in the stack complete before we call this
		
        setTimeout(function() {
            var vset = 'f0ce3f2b07b1a010c5cff1e08c1ed045';



            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);
    }

Basically we're putting it in an onload, but as a function outside of the onload, and removing the isolate script restriction so that you can call the process() function from any other script inside the item, including (with a little modification) the MVRS as it is "submitting" the row. 

Probably way more trouble than it's worth, but...

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!

So bascially I created an onload client script which apply on task , ritm and item and Isolate script to false ( unchecked) with the above script by placing my MRVS sys_id

 

created onload client script on MRVS as shown in the image above (please let me know If i call the function properly ?

and On submit on my MRVS as the code provided by you. 

I created all the 3 but still see the variable on RITM

find_real_file.png

Seems like you're setup the same way I am, but experiencing different results. Does it hide the value when you are first submitting the request? 

It seemed to hide the same both when creating a request and when viewing after submission (on the RITM), in my instance anyway. 

Maybe add an alert to the process() function and see if / when it is actually being called?

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

I see the alert when i try to create the request ( when I open the catalog item ) after adding the details and click on add to cart ( alert popup ) and cannot see the duplicate variable 

after creating the Request it is not alerting and can see the duplicate variable 

 

seems like it is not passing to RITM level ( I check the RITM check box in client script )