Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to hide Edit row and Remove row on MRVS

Kartik Magadum
Kilo Sage

Hello 

I've managed to hide the Add and Remove buttons in the MRVS (Multi-Row Variable Set). Now, I need to hide the Edit and Remove row icons as well. There's a variable called 'Contract Number,' and when it changes, certain data is automatically populated into the MRVS that time i want hide/make readonly those icons.

 

Please refer screenshots attached. 
Ui Policy:

function onCondition() {
    var my_var = g_form.getField("contract_details");
    var setTimer = setTimeout(setTimerDelay, 2000);
    function setTimerDelay() {
        alert('Timer waited for 2 seconds');
        g_form.setReadOnly(my_var, true);
    }
}

 

KartikMagadum_0-1700561128617.png

 

Any assistance in resolving the issue would be greatly appreciated. 

Thanks and Regards

Kartik Magadum

1 ACCEPTED SOLUTION

Kartik Magadum
Kilo Sage

I have solved it by changing a code to:

 

 

function onCondition() {
    var my_var = g_form.getField("contract_details");
    alert(my_var);
    var setTimer = setTimeout(setTimerDelay, 2000);
    function setTimerDelay() {
        alert('Timer waited for 2 seconds');
        g_form.setReadOnly('contract_details', true);
    }
}

 

View solution in original post

1 REPLY 1

Kartik Magadum
Kilo Sage

I have solved it by changing a code to:

 

 

function onCondition() {
    var my_var = g_form.getField("contract_details");
    alert(my_var);
    var setTimer = setTimeout(setTimerDelay, 2000);
    function setTimerDelay() {
        alert('Timer waited for 2 seconds');
        g_form.setReadOnly('contract_details', true);
    }
}