How to block column in Acumatica grid or one value in column

Hello,

I want to share with you how to block some columns in Acumatica.

You can do it with the PXUIFieldAttribute.SetEnabled method.

Let's say you have DAC PRTran with column earningType and values of PRTran you get from PaySlipDetails view. Then you can block whole column with the following call:

PXUIFieldAttribute.SetEnabled<PRTran.earningType>(PaySlipDetails.Cache, null, isEnabled);

Another question which sometime appears is how to block single record value in column.

The solution is the following:

row = .... here goes your logic which will get PRTran for which you need to make blocking

PXUIFieldAttribute.SetEnabled<PRTran.earningType>(PaySlipDetails.Cache,  row, false);

2 Comments

  • Vladislav said

    Hello! But what if I have a CacheExtension and I want to manage availability of its field? I didn't find any way to do it, because SetEnabled (or SetReadonly) accepts only Cache type, but not CacheExtension. Sorry for possibly silly question, I am novice at Acumatica)

  • docotor said

    I propose you to try PXUIFieldAttribute.SetEnabled<PRTranExt.UsrEarningType>(PaySlipDetails.Cache, row, false); I assume that Acumatica should itself try to find extension.

Add a Comment