Skip to main content

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.

 

 

 

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.


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

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]
    bPXUIField]
    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.


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


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

 

 


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