OnCell Edit make a field readonly

Shruthi2
Kilo Contributor

Hi Can someone help me with how to make a field readonly onCellEdit (No ACL)

function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
//Type appropriate comment here, and begin script below
saveAndClose = false;
callback(saveAndClose);
}

Is this the right way of doing it?

Thanks,

4 REPLIES 4

Jaspal Singh
Mega Patron
Mega Patron

Hi Shruthi,

 

May I know the business case for this as ACL of type: list_edit can simply work & is the recommended approach.

JaspalSingh, were could  I go in my PDI to see the "list_edit" ACL? I would like to review and see if I can use it as the recommended approach for the onCell edit. Thank you for sharing your knowledge and expertise.

 

Allen Andreas
Administrator
Administrator

Hi,

If you're unable to use ACL (which as Jaspal is saying is the best way to go about it), you can simply put:

callback(false);

in your onCellEdit client script as the only line and that would prevent anyone from editing it. It looks like they can, but nothing they pick or do will save or change.

function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
callback(false);
}

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi,

I just wanted to check-in on this. If my reply above helped guide you correctly, if you don't mind, please mark it as Helpful & Correct.

Thank you!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!