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

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...