All you need to know about the new features and planned functionalities for latest Business Central release in April.
Meer lezenDynamics 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!
Meer over Business Central
OIXIO
Seamless Transition to Business Central Online: High-Quality Migration for Multitenant Solution
Meer lezenFive Strategies to Boost Profit Margins Selling Microsoft Dynamics 365 Business Central
Being a Microsoft Dynamics 365 Business Central Partner isn't easy. Navigating profits margins is a complicated puzzle.
Meer lezenIsatech
How Isatech Moved Customers to Business Central Online 5 Times Faster with the Migration & Modernization Program
Meer lezenWhat You Need to Know About the MB-820 Exam: A Guide for Business Central Developers
In this blog post, you will learn what to expect from the exam, how to study for it, and how ...
Meer lezenGuide to MB-820 success with the Developer Learning Journey Track!
Unlock your potential as a Dynamics 365 Business Central developer with our targeted readiness path, designed to guide you to ...
Meer lezen