Solved

Disable one cell in a grid (not the entire column)

  • 26 September 2023
  • 6 replies
  • 167 views

Userlevel 6
Badge +3

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.

 

icon

Best answer by Vipul Gajara 1 October 2023, 02:11

View original

6 replies

Userlevel 1

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. 

Userlevel 6
Badge +3

@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.

Userlevel 1

@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. 

Userlevel 6
Badge +3

@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>>))]

 

Userlevel 6
Badge +3

@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


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved