Skip to main content
Question

Override Select All grid control checkbox

  • 24 October 2024
  • 1 reply
  • 34 views

  • Freshman II
  • 3 replies

I have a customization for the Sales Order graph that affects the Add Invoice process used by return orders. When a user selects an invoice line to be added (by checking the checkbox in the grid) it will automatically select additional lines that are related to the line selected.

This is achieved using the FieldUpdated event for the InvoiceSplit.Selected field and a RequestRefresh() call on the invoiceSplits view. Everything was working fine in version 22R2, but in updating the package for 24R1 I am running into an issue with the select all grid control.

When the select all check box in the grid header is selected, it selects every line but then it deselects the lines my code would select. Something similar happens when all lines are selected and the select all control is deselected. In that case it deselects all lines then selects the additional lines my code would select.

I know I can turn off the select all option for the grid, but is there any other way to override how the select all process works?

1 reply

  • Author
  • Freshman II
  • 3 replies
  • November 15, 2024

I originally had code on the FieldUpdated event for the Selected field to keep the additional lines’ selected fields in sync with the main line. Since the related lines had a 1:1 qty ratio with the main line I added code on the FieldUpdated event for the QtyToReturn field to keep the additional lines’ return qty in sync with the main line.

There is a circular update between the Seleted and QtyToReturn fields on the InvoiceSplt lines. When Selected is updated it triggers an update on QtyToReturn and vice versa. Because of this I had to make my FieldUpdated events only run on the initial update, but that was easily addressed with a private field indicating when the graph was in the middle of my updates and reset just before requesting the grid refresh.

I was still having an issue with select all control reversing the changes I made on the related lines. Since I couldn’t find anything on how to adjust the select all process, I ended up doing a work around with a FieldUpdating event on the QtyToReturn field - it cancels the update and throws a PXSetPropertyException warning when the related lines’ qty was updated outside my FieldUpdated events.


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