Solved

PXResult.Record registering as null despite values in the PXResult

  • 14 September 2023
  • 2 replies
  • 63 views

Userlevel 2
Badge

I’m working on the following process graph:

When debugging, the prepay.Record registers as null, despite the prepay having a single complete record of the invPrepayList resultset. 

Visual studio does not flag the application of the result.record.fields to the new rec fields as an error. It simply runs as though the record is null. 

Can anyone tell me what I am missing?

icon

Best answer by Keith Richardson 14 September 2023, 19:22

View original

2 replies

Userlevel 4
Badge +2

Since you are using a single object being returned, you can cast prepay right to APInvoice
 

foreach(APInvoice prepay in invPrepayList)

If you did a join, you would still use var, then get the item type separately, into multiple for each type. Here is an example for getting the APInvoice out of it:

foreach(var prepay in invPrepayList)
{
APInvoice invoice = prepay.GetItem<APInvoice>();

//now you can use invoice.RefNbr
}

 

Userlevel 2
Badge

Thank you, Keith. That did it. 

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