Application Area, batch adding
Good day,
we have a larger extension that has been painstakingly converted to AL from C/AL. It works nicely on BC on prem, but now having deployed it to a D365 saas-sandbox, we find out all our objects and controls/fields are missing - cannot be found and fields not visible if you manually go to the pages in question.
I find it unbelievable that we must apparently set the ApplicationArea-property for every single control for it to ever be visible. Why would anyone ever add a control, but never want it visible? And why did txt2al not add a default ApplicationArea, since this is a new requirement?
In my opinion, controls with no ApplicationArea set should by default always be visible. Alternatively, we definitely need a tool to add/modify the applicationareas of all the controls within an .al-file, or a set of files.
Hi,
The Application Areas are used to tweak the UI for different experience tiers so that, if a feature is not used, its controls will not be visible. This requires that every control is tagged with the application area(s) it belongs to. If your solution is small, you’ll likely only have one or two application areas but in a large solution you could have many. You should also consider the Experience Tiers. An Experience Tier is a collection of Application Areas that together define an experience. Out of the box we provide an Essential and a Premium experience tier. You could choose to include your application areas in either one of these Experience Tiers or define your very own experience tier.
The reason a blank control will not show up in the UI is because it means no-one has considered when this control should be shown. Application Areas are mostly used to simplify the UI when certain features are not used. We do not want to pollute the UI with controls that aren’t needed. By ensuring that every control is assigned an application area we hope to keep the UI clean and simple. If controls without an application area would be shown by default the UI would get cluttered in no-time.
The same reasoning can be applied to the question of why there is no tool to batch populate the application area. We want developers to put some thought into the Application Area and to design a clean and purposeful UI for the end user that is not cluttered with fields from features they do not use.
I hope this clarifies the purpose a little.
br/Gert
We have a large solution with probably a thousand controls spanning a few hundred pages, both extensions to existing pages and new pages, and you are seriously recommending we go through all the fields by hand, one by one?
Hi,
If you want to do it right, yes. You would start by identifying features or areas you want to control individually and creating an application area for each. You then go through the pages and tag each control accordingly.
If you do not want to define your own application area and you want your controls to always be shown, you can use application area #All.
br/Gert
Experience Tier is set per company, not per user. I don't really see why one would define multiple application areas in a large solution and then enable all application areas at once, for all users, with one single Experience Tier. What is the added value of that?
I guess most partners and customers think simple and straightforward: the fields should be displayed just because the app is installed. In my opinion it's just more complicated if fields are not immediately visible after an app is installed because you need to select a different experience tier.
Adding new application areas to an existing experience tier is even worse. They will not be enabled by default because you have to enable the existing experience tier. Which is probably already enabled, so you basically ask the user 'please switch to a another experience and then switch back to enable the new application areas'.
Of course one could enable an experience tier or application areas from the install codeunit. Which still requires the user to log out and in again. But then again, what's the real difference with just showing the fields because the app is installed?
My 2 cents...
Since Microsoft doesn't seem to be providing a reasonable way or tool to add application areas, feel free to use my glorious regex with notepad++ to insert it to every bloody field in all of your .al-pages:
Find:
field\(((.)*)\r\n((.)*){
Replace with:
$0\r\nApplicationArea = All;
You can do find and replace all with regex directly in VS Code. ;-)
@extensionsv2training What about this? https://blogs.msdn.microsoft.com/nav/2018/06/06/navapplicationareahelper/
I am closing this issue because it appears that it has been resolved. Please open a new issue if you believe this has not been resolved and reference the current issue.