0

I have created a Purchase order(Ex: PO_001) while creating a sales order(Ex: SO_001) by using menu item button "Purchase Order" in the Sales order form. Now I want to update some fields in SO_001 when a field update in PO_001 from purchase order form. For this I need to select SO_001 from PO_001 first.

How can I do that?

Stéphane Bruckert
  • 21,706
  • 14
  • 92
  • 130
Hari.V94
  • 23
  • 1
  • 6
  • you can start with sharing your code and then specifically asking what is wrong or how to improve. – shivam Dec 08 '14 at 13:29
  • Hi Shivam,Thanks for quick reply. I haven't write any code yet. All I need to know that, what is the relation between PO which is created against a sales order.And how can I know the SO no. which is related to that PO. – Hari.V94 Dec 08 '14 at 13:35

2 Answers2

0

For AX 2012, query table InterCompanyPurchSalesReference like for example:

InterCompanyPurchSalesReference reference;

while select reference where reference.PurchId == 'PO_001'
{
    info(reference.SalesId);
}
FH-Inway
  • 4,432
  • 1
  • 20
  • 37
0

In AX2009 table method PurchTable.checkUpdate:

salesTable = SalesTable::find(this.InterCompanyOriginalSalesId);

mrsalonen
  • 343
  • 2
  • 15