Sales order confirmation using X++ code

In this article we will be focusing on confirmation of a sales order using X++ code.

Confirm Sales Order

First we will see how do we confirm sales order from front end of Microsoft Finance and Operations and then we’ll jump over to do that process through X++ code.

I will list down the steps to do that sequentially.

  1. Firstly I need to open the sales order which I want to confirm and the go to Header tab and see that there is Document Status is None then click on Sell tab and click Confirm sales order button as seen in below image.
  2. Now click on OK button.
  3. Now click on OK button to confirm sales order without printing the document.
  4. It’ll take some time while confirming the sales order.
  5. Now as you see after the operation is complete this sales order is now confirmed as its Document status is now changed to Confirmation.

Confirm Sales Order using X++ code

Now we will see how to do that process through X++ code.

Use this given method below to confirm a sales order in X++ using SalesFormLetter class.

The parameter passed to this method is sales order id which needs to be confirmed.

public void salesOrderConfirm(SalesId _salesId)
    {
        SalesTable      salesTable;
        SalesFormLetter salesFormLetter;

        salesTable = SalesTable::find(_salesId);

        salesFormLetter = SalesFormLetter::construct(DocumentStatus::Confirmation);
        salesFormLetter.update(salesTable, DateTimeUtil::getSystemDate(DateTimeUtil::getUserPreferredTimeZone()), SalesUpdate::All);
    }

Thank you for reading this article hope you find it useful.

Omar Iqbal

Technical Consultant

References:

  1. https://www.schweda.net/blog_ax.php?bid=542&wdl=en
  2. http://daxingwitheshant.blogspot.com/2015/04/sales-order-confirmation-picking-list.html
  3. https://docs.microsoft.com/en-us/dynamics365/supply-chain/sales-marketing/tasks/confirm-sales-orders
Total
0
Shares
7 comments
  1. Winston here from Iowa. I just wanted to see if you need an extra hand in the way of site upkeep/tweaking, adding emails to your newsletters from my targeted database (I have millions of them that you can use). I could even setup email campaigns for lead generation emailing at no extra cost to you to send out using my mail servers. Unique blog post material, extra traffic by getting others to start sharing your site across their own social media accounts, social media management, optimizing the site, create unique videos and images using Google AI, etc also help quite a bit. I can even post ads in every capital city in the country on CraigsList for any one of their 500 categories for some immediate traffic.

    I have quite a few ways I can set all of this up and do this for you. I don’t mean to impose, I was just curious. I’ve been doing this for 22+ years and was just wondering if you needed any extra help.

    All the best,

    Winston
    tel:1-319-382-0597

  2. Aw, this was an exceptionally nice post. Finding the time and actual effort to make a top notch articleÖ but what can I sayÖ I procrastinate a whole lot and never seem to get nearly anything done.

  3. Everyone loves what you guys tend to be up too. This type ofclever work and coverage! Keep up the great worksguys I’ve incorporated you guys to blogroll.

  4. Wow! This can be one particular of the most useful blogs We ave ever arrive across on this subject. Actually Magnificent. I am also an expert in this topic so I can understand your effort.

Comments are closed.

Previous Article

Purchase order confirmation using X++ code

Next Article

Create and post free text invoice using X++ code

Related Posts