Hi All,
I wanted to correction of posted packing slip through X++ code.
Suppose I have 3 lines in salesLine and I have to correct few one of them. I have manage to do following code so far, but i am confuse how i can mark the specific line for correction.
[canBeCanceled, canBeCorrected] = custPackingSlipJour.canPackingSlipBeCanceledOrCorrected();
if (canBeCorrected)
{
salesFormLetter = SalesFormLetter::construct(DocumentStatus::PackingSlip);
//If the correct VersioningUpdateType is not set the system will try to create a new packingslip
salesFormLetter.parmVersioningUpdateType(VersioningUpdateType::Correction);
// Set the journal want to cancel
salesFormLetter.parmCallerTable(custPackingSlipJour);
//The rows below are very important. Do not know why (from google)
salesFormLetter.allowEmptyTable(true);
salesFormLetter.initAllowEmptyTable(true);
salesFormLetter.multiForm(true);
// Update
salesFormLetter.update(
salesTable,
custPackingSlipJour.DeliveryDate,
SalesUpdate::DeliverNow);
}
Above lines of code are not sufficient for correction of packing slip.
Anybody have any idea about this??