We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

How to hide Edit row and Remove row on MRVS

KartikM49574975
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

KartikM49574975
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

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