Solved

How to block the Unit price field

  • 19 March 2021
  • 7 replies
  • 72 views

Hello everyone, Can someone show me how to block the Unit price field in Sales Ordes Screen? 
Thanks in advance!

icon

Best answer by Naveen B 19 March 2021, 18:47

@jenniferflores43 You can use the below customization to make it a read-only field.

 

 

public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
        {
            protected virtual void SOLine_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
            {
                InvokeBaseHandler?.Invoke(cache, e);
                SOLine row = e.Row as SOLine;
                if (row != null)
                {
                    PXUIFieldAttribute.SetEnabled<SOLine.curyUnitPrice>(cache, row, false);
                }
            }
        }

 

View original

7 replies

Userlevel 5
Badge +3

Hi @jenniferflores43,

Do you want to make the Unit Price field to Read-Only/Non Editable field? 

Hello Naveen,

Yes, I do. 

I want to make the Unit Price field to Read-Only/Non Editable field.

 

 

Userlevel 5
Badge +3

@jenniferflores43 You can use the below customization to make it a read-only field.

 

 

public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
        {
            protected virtual void SOLine_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
            {
                InvokeBaseHandler?.Invoke(cache, e);
                SOLine row = e.Row as SOLine;
                if (row != null)
                {
                    PXUIFieldAttribute.SetEnabled<SOLine.curyUnitPrice>(cache, row, false);
                }
            }
        }

 

Thank you very much Naveen for your prompt response. I'm going to try and let you know how it looks. 

Userlevel 5
Badge +3

Sure @jenniferflores43 

Userlevel 5
Badge +3

@jenniferflores43  You can also achieve this by configuring the Automation Steps for required  Step ID (Without any code). Please find the screenshot for reference.

 

Thanks Naveen the customization you sent me worked out :wink:

 

 

public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
        {
            protected virtual void SOLine_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
            {
                InvokeBaseHandler?.Invoke(cache, e);
                SOLine row = e.Row as SOLine;
                if (row != null)
                {
                    PXUIFieldAttribute.SetEnabled<SOLine.curyUnitPrice>(cache, row, false);
                }
            }
        }

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 — 2020  Acumatica, Inc. All rights reserved