Monday, August 28, 2017

Cancel product receipt journal in X++

//Cancel product receipt journal in X++
static void CancelPOPackingSlip(Args _args)
{
    PurchTable           purchTable = PurchTable::find("CBS-000187");
    VendPackingSlipJour  vendPackingSlipJour;
    PurchFormLetter      purchFormLetter;
    ;
    select * from vendPackingSlipJour  where vendPackingSlipJour.PackingSlipId == "PS-187-1";
    purchFormLetter = PurchFormLetter::construct(DocumentStatus::PackingSlip);
    PurchFormLetter.parmVersioningUpdateType(VersioningUpdateType::Cancel);
    PurchFormLetter.parmCallerTable(vendPackingSlipJour);
    PurchFormLetter.allowEmptyTable(true);
    PurchFormLetter.initAllowEmptyTable(true);
    PurchFormLetter.multiForm(true);
    purchFormLetter.update( purchTable, 
        vendPackingSlipJour.PackingSlipId, 
        VendPackingSlipJour.DeliveryDate,
        PurchUpdate::ReceiveNow,
        AccountOrder::None,
        NoYes::No,
        NoYes::No,
        NoYes::Yes);
}

No comments:

Post a Comment

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...