Monday, 30 March 2020

Cancel Sales lines delivery Remainder in D365 F&O


 public static boolean cancelSalesLineDeliveryRemainder(SalesId _salesId, SalesExternalItemId _revnId)
    {
        SalesLine   salesLine;
        boolean     ret;
       
        ttsBegin;
         // You can use your query to find sales line.
        select salesLine
            // index salesLineIdx
            where salesLine.SalesId         == _salesId
                && salesLine.ExternalItemId == _revnId 
                && salesLine.SalesQty       == 1
                && salesLine.SalesStatus    == SalesStatus::Delivered;

        if (salesLine)
        {
            //Note don't use SalesUpdateRemain::updateDeliveryRemainder(salesLine, 0, 0) as this method is deprecated in D365 FSCM
            ret = SalesUpdateRemain::construct().updateDeliverRemainder(salesLine, 0, 0, 0);
        }
        ttsCommit;
       
        return ret;
    }

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...