Open the Purchase Order form, click on the “Order” button and then click “Invoices”. This opens the purchase invoice list populated with all related posted invoices, and they should all be there. In the RTC that is under “Related Information”.
To figure out how the relationship works, open the Purchase Order form in design mode and investigate how that menu selection is programmed.
It’s not possible to get PO no. if you post purchase invoice by using function “Get Receipt Lines”, only one alternative solution, in first posted purchase invoice line description field, you’ll get posted purchase receipt no., then from posted purchase receipt you’ll Purchase order no(PO No.)
Generally this approach is used (instead of posting invoices directly from PO) in cases, when user wishes to gather together receipts from several POs in one joined Invoice, so easy linking is impossible, as it becomes one-to-many.
Also, this method leaves POs in the PO “list”, even if they are fully received and fully invoiced - to remove them, you need to run periodically Delete Invoiced PurchOrders batch job.
When you do Get Receipts, the Receipt number is on the Invoice Line. You can retrieve the Receipt Header from there, which in turn should have a reference to the original order in the “Order No.” field.