Skip to main content
Solved

How to override the standard "Insert row" action in Sales Order Lines grid ?


Forum|alt.badge.img

Hello,

In Sales order form, I would need to override the “Insert row” standard action but I'm struggling to find the way to do this.

Does anyone have a suggestion about this ?

Thanks.

 

 

 

Best answer by Naveen Boga

Hi @ygagnaire12 We are not sure what you are trying to achieve but if you wanted to add/modify the while inserting a new row you can try with the below events.

  1. SOLine_RowInserting
  2. SOLine_RowInserted
View original
Did this topic help you find an answer to your question?

6 replies

Forum|alt.badge.img+5
  • Captain II
  • 468 replies
  • February 27, 2023

What is it that you’re needing to do?  If you can give us some more details around the functionality we might be able to make a more targeted suggestion.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • Answer
  • February 27, 2023

Hi @ygagnaire12 We are not sure what you are trying to achieve but if you wanted to add/modify the while inserting a new row you can try with the below events.

  1. SOLine_RowInserting
  2. SOLine_RowInserted

Forum|alt.badge.img
  • Author
  • Varsity I
  • 42 replies
  • February 27, 2023

Thanks to both of you for your quick replies. Sorry, I wasn't clear enougth indeed,

When we click the "Insert row" button in the grid of Sales orders lines (action "AddNew" of SOOrderEntry), this adds basically a new line in the grid.One of our customers is faced to a performance issue when running this action and we'd like to measure precisely the time spent to perform.The idea is to create an override of the "AddNew" action. This could lead to something looking like the logic below :

    [PXOverride]
    public delegate void CustomAddNewDelegate(someSuitableArguments);
    [PXButton]
    [PXUIField]
    public void AddNew(someSuitableArguments, CustomAddNewDelegate BaseMethod)
    {    
        Stopwatch stopwatch = new Stopwatch();
        stopwatch.Start();
        
        BaseMethod(someSuitableArguments);
        
        stopwatch.Stop();
        PXTrace.WriteInformation($"Process lasted {stopwatch.ElapsedMilliseconds} ms.");
    }

I don't see where the "AddNew" action is defined and I don't know which signature is expected. Maybe this is simply not the right way to proceed.


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2546 replies
  • March 20, 2023

Hi @ygagnaire12  were you able to find a solution? Thank you!


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

@ygagnaire12  It is NOT required to override the AddNew button at all.

As indicated above please work with the above events, which will help you get the solution.

Please Let me if you have any queries on this. 

 

 


Forum|alt.badge.img
  • Author
  • Varsity I
  • 42 replies
  • March 21, 2023

Hello,

Sorry Chris Hackett for my late reply and thanks to Naveen Boga for his suggestion. I suspected that, as explained in the post above, overriding the AddNew button was very likely not a good practise so, I had given up this approach. We have found an other way to get our measurement. However, I will keep in mind to use events in such cases.


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