Tech Tuesday: Using SmartConnect to Post Business Central Sales Orders

This week we are going to discuss how to use SmartConnect to post Sales Orders in Business Central. This functionality is available through the Business Central client, but not in the web services. The business logic used to batch post Sales transactions is stored in a Codeunit. This means we can use AL code to create a web service that calls the posting Codeunit.

*Note that any code provided is for use as a point of reference and will not be supported by eOne Solutions.

Creating the Service

The purpose of the service is to recreate the Batch Posting window. This means we will need all the fields in the Options section, and a method of filtering for only a selection of records.

We can accomplish this by creating a table with all the information needed for posting. Then set a trigger on the table to do the posting.

Once the table is setup, we need to create a page that can be published as a web service. This page will be an API only page, because users have no reason to access this page through the Business Central client. This will be a simple page that SmartConnect will use to interact with the table we just created to post the batch.


Reporting and Security

All these options and settings are being imported to a Business Central table, therefore we can create a simple list page to allow users in Business Central to view previously posting settings used when posting through the API. In the example link I have created a simple example of a list page(50112) as a reference, and it can be expanded on as desired.

All AL Tables require a Permission Set to ensure access can be granted as needed. So, we will need to add a permission set to our extension in an XML file.

SmartConnect Mapping

Once the extension is published, the web service will be automatically published. From within SmartConnect it will now be available as a destination. The mapping would look like the below screen shot. There are two options for ‘DocumentType’, Invoice and Order. In my example I used a source that contained the date ranges I wanted to use for posting. All of these can be set dynamically using calculated columns so the posting process would not require any manually processing.

GitHub repository with sample code.

Leave a Comment


Importing Federal Filing Status with SmartConnect into Dynamics GP
SmartConnect Office Hours: SmartConnect.com Web Services
SmartConnect Bootcamp for Dynamics NAV & D365 Business Central Integration in San Diego, CA
Tech Tuesday: Using the SmartConnect.com Web Services
SmartConnect Office Hours: Salesforce Queries


2016 SmartConnect Integration Bootcamps
Tech Tues: Automatically refreshing Pivot Tables in Excel Refreshable Reports
Happy Thanksgiving from the eOne team!
New Releases of Extender and SmartList Builder
2017 SmartConnect Integration Bootcamps



open all | close all


Business Central CRM Dynamics 365 dynamics crm Dynamics GP Dynamics NAV Econnect Employee Spotlight eone eOne News eOne Spotlight Events Excel Excel Report Builder Extender Extender Enterprise Flexicoder GP GPUG integration Meet the Team Microsoft dynamics crm Microsoft Dynamics GP Office Relationships partners Popdock release Reporting SalesForce SalesForce.com scripting SmartConnect SmartConnect.com SmartConnect Bootcamp SmartConnect Office Hours SmartList SmartList Builder SmartList Designer SmartView SQL Support Tech Tuesday Templates training Zendesk

Integrate & Automate without Any Code.

SmartList Data has Never Been Faster.

The Easiest Way to Report on GP Data.