Skip to main content
Answer

Accessing Production Number from SOLine

  • April 5, 2022
  • 5 replies
  • 85 views

Forum|alt.badge.img+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?

Best answer by Dmitrii Naumov

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

5 replies

Dmitrii Naumov
Acumatica Moderator
Forum|alt.badge.img+7
  • Acumatica Moderator
  • Answer
  • April 5, 2022

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


Shawn Burt
Jr Varsity I
Forum|alt.badge.img+1
  • Jr Varsity I
  • April 5, 2022

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


Shawn Burt
Jr Varsity I
Forum|alt.badge.img+1
  • Jr Varsity I
  • April 5, 2022

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

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


Leonardo Justiniano
Jr Varsity II
Forum|alt.badge.img+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 


Forum|alt.badge.img+1
  • Author
  • Varsity III
  • April 5, 2022

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