web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to cancel sales line via X++

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

How can i cancel salesline via x++ using the MCRSalesordercancelation  class.

Should i be calling the postcancelline() of MCRSalesordercancelation class of application suite.

If so the issue i m facing is that my sales line will not find anything in that while loop as there is only 1 sales line item i would want to cancel .

However i still need to cancel my salesline. and i cannot call cancelline() directly as it is protected.

Any suggestions.

pastedimage1617247499504v2.png

Thanks

Mav

I have the same question (0)
  • Mav Profile Picture
    on at

    Can anyone please respond. I hope MCRSalesordercancelation  is Out of box class , was expecting it to cancel sales line when called appropriately . If it does not then i guess just like older version we need to create a custom method and use below line in it for canceling sales line.

    SalesUpdateRemain::updateDeliveryRemainder(_salesline, 0, 0);

  • Sukrut Parab Profile Picture
    71,710 Moderator on at

    Not sure why you are looking at MCR classes . You can use salesUpdateRemain class that's what update deliver remainder button uses. .updateDeliverRemainder method is called  when you want to update quantities  on the salesline.

  • Verified answer
    Mav Profile Picture
    on at

    Totally agree i just got confused with names like postsaleslinecancel() & canceline(). I am ware of that salesupdateremain.

    Also checked that the static method of updatedeliverRemainder is going to get obsolete and there is similar instaance method.

    So did the following code which is working where i am passing my _salesline.

    SalesUpdateRemain salesUpdateRemain = SalesUpdateRemain::construct(); // cannot call NEW() as it is protected & hence using construct.
    salesUpdateRemain.updateDeliverRemainder(_salesline,0,0);
    
    

    pastedimage1617301853468v1.png

    Thanks

    Mav

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 611 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans