Hi Folks,
I have a code for integration using which purch orders are getting created in D365.
I am using purchCreateFromSalesOrder class for it.
The code works fine and Purch order gets created.
Now there is new req to add the notes to the purhtable and purchline from integration object, details in code below.
Henceforth wanted to check what code I need to write which will give me back the recently created purchtable and purchline from purchCreateFromSalesOrder.run
I believe if I can somehow get details of purchautocreate object created by purchCreateFromSalesOrder.run () then I can get purchtable by purchautocreate.parmPurchTable() and purchline by purchautocreate.parmPurchLine(). How do I get details of purchautocreate obj but.
class myIntClassToCreate Po
{
public void createPOFromSO(SalesTable _salesTable)
{
TmpPurchLinePrice tmpPurchLinePrice;
PurchCreateFromSalesOrder purchCreateFromSalesOrder
RecordInsertList tmpPurchLinePriceList;
tmpPurchLinePriceList = new RecordInsertList(tableNum(TmpPurchLinePrice));
int totalLines = integrationObj.Count
for (int = 0 , 1 < totalLines; i )
{
intObjLine = intObjLines.get(i);
tmpPurchLinePrice.clear();
tmpPurchLinePrice.field1 = some val
tmpPurchLinePrice.fieldN = some val
if(tmpPurchLinePrice.validateWrite())
{
tmpPurchLinePriceList.add(tmpPurchLinePrice);
}
} // for end
tmpPurchLinePriceList.insertDatabase();
purchCreateFromSalesOrder = PurchCreateFromSalesOrder::construct();
purchCreateFromSalesOrder.parmCallerRecord(_salesTable);
purchCreateFromSalesOrder.parmTmpPurchLinePrice(tmpPurchLinePrice);
purchCreateFromSalesOrder.parmSalesTable(_salesTable);
purchCreateFromSalesOrder.tradeLineDlvType(tradeLineDlvType::None);
purchCreateFromSalesOrder.run();
// PO gets created at .run() above
/*I need to insert integrationObjPOHdr message at purchtable level docuref
so how do I get details of purchtable created from .run above , so that I can pass it
to my custom createdocuref() which would insert/update docuref.
and
I also need to insertObjPOLine message at purchline level docuref, so how do I get
details of purchline created one at time so that I can validate at my end if intpurchlinemessageobj
has value then call my docuref method to insert/update purchline docuref.*/
}// method end
} // class end
Thanks
Mav