Good morning,
I am trying to do Partial Product Receipt through x code.
There are many blogs i found but i want to know what is the right way of doing.
static void PO_partialpackingslip(Args args)
{
PurchFormLetter PurchFormLetter;
PurchTable PurchTable;
date _ReceivedDate = systemDateGet();
PurchId _purchId = "000403";
PurchLine purchLine;
;
PurchTable = PurchTable::find(_purchId,true);
ttsBegin;
while select forUpdate * from purchLine
where purchLine.PurchId == PurchTable.PurchId
{
purchLine.PurchReceivedNow = 5;
purchLine.update();
}
ttsCommit;
purchFormLetter = purchFormLetter::construct(DocumentStatus::PackingSlip);
//Enum name is recorded, label is registered
//change enum on purchUpdate to change what value(s) are posted
PurchFormLetter.update(PurchTable,"test",systemDateGet(), PurchUpdate::ReceiveNow,AccountOrder::None,NoYes::No,NoYes::No);
}
I am not sure why we have to update PurchReceivedNow in the code?
Or should i have to do this way
https://dynamicsaxinsight.wordpress.com/2015/10/22/ax-2012-post-product-receipt-of-purchase-order-in-xpp/
Please show some sample example how can i do partial product receipt using x .
Regards,
Have a nice day.