Solved

Accessing Production Number from SOLine


Userlevel 4
Badge +1

Hello - On a sales order you can tick a sales order line as ‘Mark for Production’, then use the ‘Create Production Orders’ action to create production orders.

What is the best way, in code, to get from SOLine to the production details, such as ‘Production Nbr’?

The production info isn’t available from the main SOLine object so I’m thinking that I need to access a graph extension. 

I tried this:
var rowExt = PXCache<SOLine>.GetExtension<SOOrderEntryAMExtension>(soLine);

but this cannot be compiled due to a type conversion issue. I’m not sure that SOOrderEntryAMExtension is actually a graph at all. Does anyone know if there is a way to get the ‘Production Nbr’ from an SOLine object?

icon

Best answer by Dmitrii Naumov 5 April 2022, 16:41

View original

5 replies

Userlevel 7
Badge +5

I think what you need is var rowExt = PXCache<SOLine>.GetExtension<PX.Objects.AM.CacheExtensions.SOLineExt>(soLine);

Userlevel 5
Badge +1

So you just want to retrieve the Production Nbr column for the SO Order that the SO Line is linked to?

Userlevel 5
Badge +1

Dmitrii is correct (as if there was any doubt ;) )

the field you are looking for in that extension is:
AMProdOrdID

Userlevel 6
Badge +4

SOOrderEntryAMExtension is a Graph extension of SOOrderEntry… You can access production record by doing:

 

<your graph>.Caches[typeof(SOLine)].GetExtension<SOLineExt>(soLine);

 

Remember if you are coding on an old version of Acumatica, to include JAMS.AM 

Userlevel 4
Badge +1

Thanks for the replies. Dmitrii’s suggestion of using PX.Objects.AM.CacheExtensions.SOLineExt worked first time. 

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