Dynamics Business Central / NAV Developer Digest - Vol. 473

Dynamics Business Central / NAV Developer Digest - Vol. 473

ArcherPoint’s Developer Digest focuses on Microsoft Dynamics 365 Business Central and Dynamics NAV development. This week’s volume includes transferring a BC SaaS environment to another tenant, Business Foundation Layer in the main branch of BC, using TrimStart() and TrimEnd(), and Developer Tip of the Day: Azure File Storage.

The Dynamics 365 Business Central community comprises professionals devoted to advancing the success of their customers. Developers, project managers, and consultants collaborate to share helpful information across blogs, forums, and social media sites. From discovering new solutions to finding answers to complex issues, these dedicated individuals are constantly sharing their knowledge with others. At ArcherPoint, we recognize and appreciate this highly engaged community’s creativity, hard work, and collective intelligence. To ensure all users can benefit from their expertise, we want to share their wealth of information with everyone.

Transfer a BC SaaS environment to another tenant

Stefano Demiliani explains how it is now possible to transfer a BC SaaS environment to another tenant by specifying the Entra tenant ID of the destination tenant. The environment data will be preserved during the move. Also, localization, Azure region, and type of environment (Production or Sandbox) will remain the same and can’t be changed during this operation.

Business Foundation Layer in the main branch of BC

Krzysztof Bialowas (aka KB) tweeted about the new Business Foundation Layer for BC:

I am not sure if everyone noticed, but something BIG happened in #MSDyn365BC BCApps repository.

The PR with 250 commits, 70 changed files, over 18k lines of code, 15 reviewers from MS and community, and over 250 comments has been merged.

All – we now have a Business Foundation Layer in the main branch. This layer adds common Business logic on top of System Application, making it easier to create extensions and ISV solutions.

Every AL Dev should check it developing new pages that use No. Series.

Check out the Business Foundation Layer on GitHub.

Using TrimStart() and TrimEnd()

Yann Saint-Laurent posted the following about ext.TrimStart and Text.TrimEnd:

I thought I knew how to use this simple AL function, but I learned that it does not work as I had expected.

I had written a piece of code that created Record Links and I was using url.TrimStart(‘http://’).trimStart(‘https://’) when passing the URL to it. Someone noticed that one of the URLs starting with “https://prime….” was missing the first “P”.

I ran a few tests and noticed that this function will remove all the characters that you pass into the it until it hits the first one that is not in the function.

So, if my URL was https://archerpoint.com and I trimstart(‘://abcdefghijklmnopqrstuvwxyz’) the result would leave me with .com because the first character that was not passed as a param is the “.” dot.

Here is a better way to achieve the same thing now:

if url.StartsWith('http://') or url.StartsWith('https://') then
     url := url.TrimStart('htps').TrimStart(':/');

The first TrimStart removes the h, t, p and possibly s.

The second TrimStart removes the : and the 2 /

Hope this helps.


Matt T replied:

I’ve only ever used trim to remove blank spaces from the fronts and ends of strings. I didn’t know it worked that way either. One thing people forget about, me included, is that BC has a full regular expression library built into it that you can use to do this.

Developer Tip of the Day: Azure File Storage

Kyle Hardin posted:

In 23.3, Microsoft added a tool to the Base App for Azure File Storage File Shares (or Azure File Storage for short). They already had support for Azure BLOB storage, but file shares have the advantage in that (a) they can be mounted as an SMB drive for an OnPrem computer (file shares in the sky) and (b) are much simpler to read and write to than SharePoint.

Interested in Dynamics NAV and 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