#BCdevTips 9: Hey Field! Why can’t I see you?

First time when I created Page Extension in Business Central I was very surprised that my field and action is not visible. Wait have I done something wrong? Maybe I put the field in wrong place or maybe I opened wrong page?

No… all is fine (almost)

Before I will write what I did wrong, let’s prepare some example. I created Page Extension for Customer List page. I added one field at the end of repeater – Blocked and one action in Documents Group- Hello.

Here is example in NAV 2018

The efect you can see on below screen from Web Client

All works!

Let’s run the same code in Business Central and effect is below. Where are you my code?

So now what is wrong? Only one thing was missing and remember to not forget about it when doing your development.

Always add ApplicationArea

Just one thing was missing and this was ApplicationArea property on the field and action. Yes, yes, yes – I know it is not something new and only in Business Central but now it is really working. This property is responsible for showing controls in specific areas of application which is set for the current user – you can use it with APPLICATIONAREA function if needed.

How to set ApplicationArea property? You can check below screen

The result you can check below – again all works fine!

 

What value I should use?

When you want to add ApplicationArea you need to put the text. So from were you can take the values? For now they are taken from Application Area Setup table (9178). Simply type the same value as it is there without whitespaces.

Additionally if you want to show a control in whole application areas then you can simply type All.

Most used values in Standard Application are Basic (over 10000 times), Advanced (over 7000 times) and All (over 4000 times)

My concerns

I still do not know if I like it or not. Maybe I do not know all about it yet so that is why I faced some problems? When I was preparing this post I tried to check where in standard code it is set with APPLICATIONAREA code – and no luck (at least for now). I cannot see any place where it is set except some function but even if I unmark the areas to be shown in my company I have still seen them – if you know please leave comment. From other hand I have set it up by myself in the code. For example:

APPLICATIONAREA(‘#Basic’)

And it works – I had seen only Actions which had been set with Basic Application Area. However I had very big issues to unset it. When I unset it like this:

APPLICATIONAREA(‘#All’)

I did not see all actions. When I tried to put more areas still something was missing so I tried:

APPLICATIONAREA(”)

And yes this works… even to good because I have seen also controls which do not have the ApplicationArea property.

Also we need to remember about one thing: This functionality is design not for on-promise version – Statement from Microsoft Docs:

Do not use application areas if your solution is for on-premises deployments only

How I will use it?

For now I am not sure if I would be able to use it in my projects. I see potential in it to control in more advanced way which data user sees on the screen, from other point of view I do not remember many of such situations and probably I would at first think about Page Customization than application area.

For sure if I will develop something specific for Manufacturing, Jobs or Service I will put proper Application Area which correspondence to this modules.

 

Add a Comment

Your email address will not be published.