InventTransInvoice::unpostedPurchInvoiceId Method [AX 2012]
Retrieves the invoice ID of any unposted invoices for the specified inventory transaction.
Syntax
server protected static UnpostedInvoiceId unpostedPurchInvoiceId(InventTrans _inventTrans, InventTransOrigin _inventTransOrigin)
Run On
Server
Parameters
- _inventTrans
Type: InventTrans Table
The inventory transaction for which the unposted invoice ID is found.
- _inventTransOrigin
Type: InventTransOrigin Table
The inventory transaction originator related to the _inventTrans parameter.
Return Value
Type: UnpostedInvoiceId Extended Data Type
An invoice ID for the unposted invoice; otherwise, an empty string.
Remarks
This method assumes the current record is already known to be a purchase type transaction and in a received or deducted state. It should only be called from the unpostedInvoiceId method.
The following invoice IDs can be returned from this method:
An empty string; if the receipt status is not received or there are no unposted invoices.
"New" if there is a single unposted invoice without an ID assigned.
An invoice ID if there is a single unposted invoice with an ID assigned.