Skip to main content
Solved

Segmentmask edit disable


how can i remove edit option on customer field in custom sales order screen(allowedit true in aspx), tried setenabled in graph did’nt work

 

PXUIFieldAttribute.SetEnabled<SOOrder.customerID>(Base.Document.Cache, null, isEnabled: false);

Best answer by aiwan

Did you set the data to the current record? I see in your handler it is null.

 

you could also set it as disabled in the workflow engine.

View original
Did this topic help you find an answer to your question?

5 replies

  • Author
  • Freshman I
  • 2 replies
  • January 31, 2025

Basically looking for options other than aspx remove allowedit, able to make it invisible using setInvisible but setenabled not working. Wondering if anything else need to code apart from just setenabled ?


Forum|alt.badge.img+8
  • Captain II
  • 357 replies
  • February 7, 2025

Hi ​@naveenBCF 

 

The allowedit = true means there is a hyperlink to the related record.

You should toggle visibility and manipulability of fields within the RowSelected event handler.

Something like this:

protected virtual void _(Events.RowSelected<SOOrder> e, PXRowSelected b)
{
    SOOrder row = e.Row;//Get the current record
    if (row == null) return;

    b?.Invoke(e.Cache, e.Args);//Invoke base handler if there is one


    if(row.Status == "N" || row.Status == "H" || row.Status == "Y" || row.Status == "Z" || row.Status == "X" )//Your condition to toggle manipulability, this is not necessary in all cases
    {
        PXUIFieldAttribute.SetEnabled<SOOrder.freightCost>(e.Cache/*Cache of the record*/, row/*The current record*/, true /*True/False*/);
    }
    if(row.Status == "S")
    {
        PXUIFieldAttribute.SetEnabled(e.Cache, row, false);
    }
}

 


  • Author
  • Freshman I
  • 2 replies
  • February 10, 2025

Thank you for the info & intention to help, as mentioned in description already tried setEnabled on field with RowSelected event. Cannot disable ui field.

Tried as you suggested but its the same.


Forum|alt.badge.img+8
  • Captain II
  • 357 replies
  • Answer
  • February 15, 2025

Did you set the data to the current record? I see in your handler it is null.

 

you could also set it as disabled in the workflow engine.


  • Freshman II
  • 3 replies
  • February 15, 2025


Hi @naveenBCF, you can also try from the project customization screen in the field properties and set "Enable" to false.

Sometimes thats the only way.

Best Regards


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