The views and opinions expressed in this blog are those solely of the author(s) and do not necessarily reflect Microsoft’s current policy, position, or branding. For official announcements and guidance on Dynamics 365 apps and services, please visit the Microsoft Dynamics 365 Blog.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 release wave 1 Discover the latest updates and new features to Dynamics 365 planned through September 2020
Release overview guides and videos Release Plan | Preview 2020 Release Wave 1 Timeline
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
I wonder how many of us think that AL is C/AL but in nicer packaging? And because of that do not think that some, even small things, could be written differently and more easily.
That’s (I must confess) sometimes is also my case.
Lately, I found out that, there are things which I did not expect. For example, there are methods for the text variables.
I was used to using CopyStr(), DelStr() or for example LowerCase(), and never thought it can be done in a different way.
It turned out that there are methods which can help. Also, it seems they are there for quite a long time so maybe it is just me who missed them?
You cannot find the same in C/AL.
Very simple. Let’s check the easiest example – I want to print all in capital letters. I can do it in two ways. Either use the method UpperCase() or can use a method on the text variable instance.
But there are more useful things. For example, when you want to check if your string contains some substring in the past you needed to check if the position of substring is different than 0.
Now you can get it more elegantly. Simple use Contains() method on the text.
I will show you one more example. Let’s remove some characters from the end of the string. You can use the method TrimEnd() instead of DelChr().
The methods work not only on variables. But also, on methods or procedures that return the text. For example on Format().
I only showed a few examples here. Must say that I was surprised when someone showed it to me. And I like it very much. If you are interested to find more what can be done you can info about this on Microsoft Docs https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/text/text-data-type
Business Applications communities