Skip to main content

I think the answer is no, but I have to ask.  Is there a way to disable a field in a grid, but not the entire column?

If an item is not a stock item, I want to disable a field in a grid, but just for that row.

 

Hi, 

I think you can do it by specifying the field that you want to enable/disable, if no field was filled then the whole row will be disabled/enabled. 

PXUIFieldAttribute.SetEnabled<F>(cache, data, condition);

 

Hope this helps. 


@lgalleno31 Thanks for the reply.  Unfortunately, what I find is that that will disable the field, but it disables it for the entire column, whereas I just want one “cell” in the grid disabled.

This is not a show-stopper for me, but my custom column can cause UI confusion if the line is a non-stock item.  I think I will work around it, but I thought I’d see if anyone has found a way.


@lgalleno31 Thanks for the reply.  Unfortunately, what I find is that that will disable the field, but it disables it for the entire column, whereas I just want one “cell” in the grid disabled.

This is not a show-stopper for me, but my custom column can cause UI confusion if the line is a non-stock item.  I think I will work around it, but I thought I’d see if anyone has found a way.

Is this an existing screen? If yes, you can modify the workflow as well, and at the same time add the code on the backend. There are times that the backend code is not working because the workflow dominates the entire UI states. 


@lgalleno31 Thanks for the tip.  I will take a look at doing it through a workflow.  It is the Opportunities screen with a Usr field in the grid.


@Joe Schmucker You should try adding PXUIEnabled attribute on the filed that needs to be disabled conditionally.

[PXUIEnabled(typeof(Where<SOLine.isStockItem, Equal<True>>))]

 


@Vipul Gajara Thank you for taking the time to provide input!

I added that code (with tweaks to fit my DAC) and it works great. 

THANK YOU.  


Reply