Solved

Query last sold info for sales order line

  • 11 October 2021
  • 2 replies
  • 66 views

I am trying to add some more info to the Availability status at the bottom of Sales Order - Details grid. 

Specifically, I am trying to pull the last sold cost for the sales order header’s customer and the sales order detail/line inventory ID field. Is there an imbedded way/function to load this price or will this require the PXSelect methodology? Thanks!

icon

Best answer by Naveen Boga 12 October 2021, 22:17

View original

2 replies

Userlevel 7
Badge +17

Hi @ryanmoon32  I have NOT tried this method, but this method will gives you the previous records values. Can you please check and verify. 

public void _(Events.RowPersisting<SOLine> e)
{
var line = e.Row;

if (line == null) return;

var persistedLine = (SOLine)e.Cache.GetOriginal(line);


}

 

Userlevel 6
Badge +5

If I am understanding correctly you are looking to basically surface the most recent sales price for a given customer/inventory item combination?

I don’t believe there is any sort of native functionality for this so you would have to use BQL or FBQL to retrieve the most recent SOLine and graph the price from that. 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved