#NAVdevTips 6: Let’s play hide and seek

Have you customers ever asked you to hide some fields on page just for few people but leave all other for all users? For example show simple Item or Vendor Card or hide all fields on General Ledger Setup but show only to some people Allow Posting From and To fields? I bet they did.

If you read one of my previous post about tables you already know that we have something called tableextension. With pages we have very similar object – pageextension, but we also have pagecustomization. Today I will write about customization which may help you examples above.

You can get Page Customization adding new file to your project and simply write tpagecust

Page Customizations – what we can (not) do?

The answer is we cannot do much with it. This type of page is used only for layout changes. Means you can’t create any new fields and actions. You also can’t add any variable or code to this object.

So seriously why we need them?

We can only change the existing fields and actions – and by change I have on mind hide or move them in other places on page. Nothing more. So you can check my customization below. what I wanted to do here is:

Hide FastTab Payments

Hide field Search Name

Move field Home Page to last position in FastTab Invoicing

Hide action Ship-to Addresses

Move to first position in History group action New Reminder

Move after action Dimensions action Ledger Entries

 

Oh wait there is also one additional thing to do here. You can add FreezeColumn for the group on List Page. It adds the freeze pane after some field Рthe same as in C/AL was doing FreezeColumnId

Hmm. Is this even working?

Do not be surprised that when you will run your Page Customization you will not find any differences on the page.  Our customizations are not for everyone. In fact you need to choose for whom they are. And for that we will use another object РProfile (snippet is: tprofile).

Adding it is very easy just choose:

name (which later will be created as profile Code)

description

role center

and our customizations (you can add more using comma).

As you can see it will be marked as Scope – Tenant and you will also see name of extension.

Now you just need to assign profile to user and all changes are applied. And below you can see some examples what had been done.

Before left and after you see on right:

 

Did you notice?

Did anyone of you notice something when declaring the page customization? If not then check again… there is no id of customization so remember that it must be unique.

 

One Comment

Add a Comment

Your email address will not be published. Required fields are marked *