I get asked about device licenses in Business Central on a regular basis, and it's true, there are quite a ...
Læs mereDynamics 365 Business Central: The importance of using a prefix or a suffix
Wednesday, April 3, 2019
Reading time: 2 minutes
We’ll explore the importance of using a prefix or a suffix when writing AL code for Dynamics 365 Business Central and how they impact the outcome of your solution.
Let’s investigate this concept by creating two apps, we’ll name the first one ‘GreetingsApp’ and the second ‘HelloApp’.
The source code of the apps
The source code of these apps are quite similar, but the main differences are that the object ID, object name, action caption and HelloMsg values are different. Notice how the action name is the same in both apps, we’ll come back to this shortly as this is where a prefix or suffix can provide an advantage.
Let’s install those two apps in Dynamics 365 Business Central and once installed, we’ll open the customer card to check that both apps appear in the customer card, see image below.
Next, let’s click on either action; ‘Greetings Message’ or ‘Hello Message’ and notice that the same ‘Hello!’ message appears for both actions (see image below). This demonstrates what happens if we omit a prefix or a suffix in the action name!
In order to fix this problem, we must modify the code of the apps to add a suffix or a prefix to the action name, see image 5 below.
Once we add a prefix or a suffix to the action name we can then test our apps to check if we are getting the right messages from the actions (see images below).
The apps are now displaying the correct messages since we added a suffix to the action name. To ensure success with using a prefix/suffix, it’s important to keep a few things in mind:
- The prefix/suffix must be at least 3 characters.
- The object/field name must start or end with the prefix/suffix.
- If a conflict arises, the one who registered the prefix/suffix with Microsoft always wins.
We hope this post has provided you with a better understanding of the benefits of using a prefix or a suffix in Dynamics 365 Business Central app development. If you have any questions or need help with Dynamics 365 Business Central app development, contact your nearest Companial Team today!
Mere om Business Central
Business Central 2024 Release Wave 2 Preview Version is Now Available!
The preview version of Microsoft Dynamics 365 Business Central 2024 Release Wave 2, also known as version 25, has officially ...
Læs mereDeep Dive: Managing Updates in Business Central 2024 Release Wave 2
In my previous series of four blogs, I provided an overview of the exciting changes coming to Microsoft Dynamics Business ...
Læs mereCoPilot Changes in Business Central 2024 Release Wave 2 (v25)
As we delve into the final instalment of our blog series on the upcoming features in Microsoft Dynamics 365 Business ...
Læs mereArchitectural Enhancements in Business Central 2024 Release Wave 2 (v25)
As we continue our exploration of the upcoming features in Business Central 2024 Release Wave 2 (v25), this third blog ...
Læs mereFirst Look: Exciting New Development Features in Microsoft Dynamics Business Central 2024 Release Wave 2 (v25)
Microsoft Dynamics Business Central continues to evolve, and the upcoming 2024 Release Wave 2 (v25) is packed with new development ...
Læs mere