Monday, 30 March 2020

Cancel DeliveryNote (or Packing Slip) in D365 F&O


public void cancelDeliveryNote(SalesId _salesId)
    {
        CustPackingSlipJour  custPackingSlipJour;
        boolean                       isCancelEnabled;
        boolean                       isCorrectionEnabled;
       
        select firstonly custPackingSlipJour
            order by PackingSlipId desc
                // PackingSlipIdx
                where custPackingSlipJour.SalesId == _salesId;

        [isCancelEnabled, isCorrectionEnabled] = CustPackingSlipJourFormHelper::areCancelCorrectButtonsEnabled(custPackingSlipJour);

        if (isCancelEnabled == true)
        {
            Args args = new Args();
            args.record(custPackingSlipJour);
            new MenuFunction(menuitemActionStr(SalesFormLetter_PackingSlipCancel), MenuItemType::Action).run(args);
        }
    }

No comments:

Post a Comment

Insert/Update or remove the default dimension value in D365 FSCM via x++

Use below method to insert/update the dimension values, just pass the parameter values to the method and it will return the updated value: p...