Dynamics NAV / Business Central Developer Digest - Vol 391

Dynamics NAV / Business Central Developer Digest - Vol 391

ArcherPoint’s Developer Digest focuses on Microsoft Dynamics 365 Business Central development and Dynamics NAV development. In Developer Digest Volume 391, you’ll learn about using configuration packages for data import/export, job queue fail notices, the AL indentation issue, and get/set nested records through Business Central web services.

The Dynamics NAV and Business Central community, including the ArcherPoint technical staff, is made up of developers, project managers, and consultants who are constantly communicating, with the common goal of  sharing helpful information with one another to help customers be more successful.

As they run into issues and questions, find the answers, and make new discoveries, they post them on blogs, forums, social media…so everyone can benefit. We in Marketing watch these interactions and never cease to be amazed by the creativity, dedication, and brainpower we’re so fortunate to have in this community—so we thought, wouldn’t it be great to share this great information with everyone who might not have the time to check out the multitude of resources out there?

So, the ArcherPoint Microsoft Dynamics NAV/BC Developer Digest was born. Each week, we present a collection of thoughts and findings from NAV/BC experts and devotees around the world. We hope these insights will benefit you, too.

Importing and Exporting Data using Configuration Packages

Microsoft Dynamics 365 Business Central users can import and export data into Business Central using Configuration Packages. Configuration Packages let you import data from Excel files then validate and apply the data into the system. Alberto Soben offers a great tutorial on how to use Configuration Packages in in his recent blog, the Definitive Guide To Configuration Packages In Business Central.

Job Queue Fail Notifications

Business Central provides the ability to schedule tasks using the Job Queue. Stefano Demiliani explains how users can be notified when tasks using the Job Queue fail. When completed, you will receive job queue failures alerts via email and also as a push notification on your phone. You can also see the details of all the notifications from the Azure Mobile app. Read more at Dynamics 365 Business Central: set up alerts on job queue failures.

AL Indentation Issue

There’s quite a bit of talk in the Twitterverse about the “weird indentation issue” in AL that seems to have appeared out of nowhere. If this is bothering you, Daniel Rimmelzwaan shows how to quickly install another version of AL where indenting is working as expected in his recent twitter post.

Get / Set Nested Records Through Business Central Web Services

Heinrich shares something he’s been working on: “I have been battling to find a way to use web services to get a list of records with child records in a single call. For example, to extract a list of sales orders with their lines. I found that it is very simple once you know how. Steve Endow wrote a blog about using $metadata and $expand with BC, but it seemed to be missing a piece when I tried it (playing with it for a few hours) and also looking at some inputs regarding deep insert with BC APIs from AJ Kauffmann.

Then I realized there was a bit they did not explicitly state surrounding the ‘expand’ parameter. Here are the details.

To simplify things, I will expose the standard V2 API for sales orders (page ID = 30028). I set that up in Web Services using service name ‘APIV2SalesOrders’ (you could name it anything though).

Expose standard V2 API for Sales Orders in D365 Business Central

Then when I called the web service using the link it displays the headers (list of sales orders) perfectly. The link looks like this:

To get the lines to show, use the service name concatenated to the name of the entity set (you can see this in the code on the page part) in an expand parameter:
https://api.businesscentral.dynamics.com/v2.0/{tenantID}/Pro…(‘CRONUS USA%2C Inc.’)/APIV2SalesOrders?$expand=APIV2SalesOrderssalesOrderLines

This retrieves the headers and lines for all sales orders in the system. You can obviously add filters using the $filter command line parameter.
You can go further and have multiple expand parameters listed in the case you may have more than 1 nested pages.

Note that this can be used to retrieve records and to modify/insert nested records.

Happy coding!”

Tom adds: “I found more Web Services tips and trick in this article, Working with API limits in D365 BC.”

Interested in Dynamics NAV and/or Business Central development? Be sure to see our collection of NAV/BC Development Blogs.

Read “How To” blogs from ArcherPoint for practical advice on using Microsoft Dynamics NAV and Dynamics 365 Business Central.

Trending Posts

Stay Informed

Choose Your Preferences
First Name
Last Name
Subscription Options
Your Privacy is Guaranteed