Finance & Operations

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
omar_iqbal

Recent Posts

Create and Update Rows Using a Plugin in Microsoft Dynamics CE (CRM)

Microsoft Dynamics CRM is a powerful Customer Relationship Management (CRM) tool that helps businesses manage…

2 years ago

Assign record owner to specific Team using Power Automate flow in Microsoft Dynamics CE (CRM)

Today we will be going over the steps how to assign owner to specific Team…

2 years ago

Set lookup in Microsoft Dynamics CE (CRM) using JavaScript

Today we will be going over the steps how to set the value of a…

2 years ago

Create and post free text invoice using X++ code

In this article we will see how we can create and post free text invoice…

3 years ago

Purchase order confirmation using X++ code

In this article we will be focusing on confirmation of a purchase order using X++…

3 years ago

Create and post inventory ownership change journal using X++ code

In this article we will see how we can create inventory ownership change journal using…

3 years ago