Skip to main content
Solved

How to block the Unit price field


jenniferflores43
Freshman I

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

Best answer by Naveen Boga

@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
Did this topic help you find an answer to your question?

7 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • March 19, 2021

Hi @jenniferflores43,

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


jenniferflores43
Freshman I

Hello Naveen,

Yes, I do. 

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

 

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • Answer
  • March 19, 2021

@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);
                }
            }
        }

 


jenniferflores43
Freshman I

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


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • March 19, 2021

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • March 19, 2021

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

 


jenniferflores43
Freshman I

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings