Tip #19 – Change Rolecenters from the Role Center

This Blog Article was brought forward from my old blog

For consultants it might be nessesairy every now and then to change Role Center for testing purposes.

You can change your Role Center in table 2000000073 – User Personalization and page 9172 – User Personalization Card

But to go there is quite a hassle. So I decided to add this to my Database Information page I created in Tip #18

The CurrentRoleCenter variable is of Text 50.

This will find the current Role Center in a function. I’ve added two functions.

With this code

Where Text001 is this text

The function ChangeRoleCenter is called from the OnDrillDown of the CurrentRoleCenter field.

So now our page looks like this.

Download the page here

Tip #18 – NAV 2009 RTC – Which database am I logged into

This Blog Article was brought forward from my old blog

We al know this blog entry of Waldo. It shows you how you can see what database you are logged onto.

Now with the Role Tailored Client we have the same issue. All these years of R&D at Microsoft and no one had a brigt moment of implementing this. Stick out tongue

Off course you can see the companyname very clear. But you also want to see if you are in the testdatabase or production.

Now how did I implement this.

Step 1 – Create a new page

We create a new page. Do not use the wizard and do not choose a sourcetable.

Make sure your page looks like this.

Step 2 – Declare global variables

This page needs two variables, one Text and one record of type 2000000048.

Step 3 – The C/AL Code

Our page needs a little piece of C/AL code

As you see we take in account that not everyone has permissions to see the Database table. A user will get a message when he/she has no permission.

Step 4 – The Text Constant

Step 5 – The Page Properties

Step 6 – Coloring Cool

The coloring is done in the properties of the Databasename field.

Step 7 – Add the page to a role center

To make it work you need to add the page to each role center that needs this functionality

I  our case this is rolecenter 9006

And that’s it.

Off course you can also add all the stuff from Eric’s blog as well.


Download the page including this information here

Tip #17 – The DataSetFieldName property

This Blog Article was brought forward from my old blog

Last week I created my first RTC report. An exiting experience I can say. Stick out tongue

To be honest I was not really looking forward, but as it went I became more and more entousiastic.

As most of you know the RTC reports use a dataset. This dataset is a XML file that is rendered in a SSRS like way.

The basics for this dataset is the classic report layout. Every item on this layout is a part of the dataset, so even if you do not want to use the classic client you need to maintain the classic dataset in some way.

The dataset has a weird way of naming the individual components.

This is inherrited by the DataSetFieldName property. Every control on the report has one.

Let’s add a new one.

If we now save the report the DataSetFieldName gets populated automagicaly

And is shown in the Visual Studio Layout

If you change the DataSetFieldName property this name in the RDLC layout will also change.

Now you can drag and drop this item to the report.


Tip #16 – The ‘Enter’ shortcut

This Blog Article was brought forward from my old blog

One of the great things about the Role Tailored Client is it’s intuivity. People who have never worked with NAV can handle the client perfectly.

As I was going through some issues with an enduser two weeks ago this became clear to me again.

You might know that the RTC always starts with an embeded list page before going to the card page.

Now I always used to doubleclick the mouse or clicked CTRL+SHIFT+E. Now this used pressed Enter and the card opened.

DUH.  Stick out tongue

Tip #15 – Execute Actions on subpages from the Action Pane

This Blog Article was brought forward from my old blog

The NAV 2009 role tailored client has this great feature called the action pane.

This allows you to execute tasks on a page that used to be the menubuttons in the classic client.

The major advantage of this action pane is that it’s more clear to the end user (intuitive) and the end user can modify how it looks bu personalisation.

One of the drawbacks of this functionality is that it does not allow you to execute actions on the subpages. This needs to be done via this stupid small lightning button which noone can find. Not intuitive at all.

So wouln’t it be great if you can execute this from the Action Pain? Yes, you can!

How do we do that.

Step 1 – Add an Action Group

This is a new feature in SP1.

Open page 42 and go to the properties. Here we change the PromotedActionCategoriesML and add the lines.

Please notice that we leave the first and third empty because they are reseved for ‘New’ and ‘Reports’.

Next we are going to add the line actions to the actions of the page.

Because the RTC hides actions that do nothing we add a MESSAGE statement to the action

Now when we run the page the lines appear in the actions.

And the messagebox appears

Next step is to add the action to the action pane. This is done in the properties of the action.

Off course we use the Dimensions image and we promote it. The category is 4, the one we added before in the page properties remember?

So now, when we run the page it looks like this.

But, it does not activate the actions on the lines. How do we do that?

My idea is to use the windows sendkeys. Remember this feature? In the classic client I always use that to close the client from codeunit 1 if people login twice.


So if we implement this we need to send CTRL + SHIFT + D.

Let’s go back to the action C/AL code and implement this

Now when we push the button again this will happen

Off course you need to place the cursor on the correct salesline first.


Tip #13 – Shift F2 on indexkeys…

This was also a great tip for me. I saw someone do it when I was onsite at an enduser.

Everyone who works with the key’s in NAV tables hassled with this, I am sure.

When you hit F6 on a key you get the field list. This is only usefull when you add a key on one field. What you want is to go to the form that allowes you to add more than one keyfield.

This (seems to be) able to achieve with shift+F2.

Tip #12 – Migrate from Native to SQL Server – Keys

This Blog Article was brought forward from my old blog

It has been almost two years since I presented a successfull session at Directions USA about migrating from the Navision Native (C/Side or Classic) database to SQL Server. This session was repeated in EMEA half a year later.

You can download the slides here.

It was only recently that I found another thing you have to realise when you migrate. It was related to table 49 Invoice Post. Buffer.

Some of you might know that it is used in both codeunit 80 and 90 to combine G/L entries by (VAT) posting groups and some other stuff. This is done by doing a trick in the uniqueness of the records. If you want to add a criteria you must first add the field to the table and then to the keys.

A classic example is to add the posting description to the G/L Entries.

A native database can have up to 20 fields in the primairy key. However, the SQL database only allows up to 16 key fields in the clustered index. If you try to add more you will get this message:

Even though this table wil never be populated on SQL Server NAV maintains the table definition there.

As far as I know there is no solution for this other than reducing the number of fields.



Tip #11 – The ‘page’ variable

This Blog Article was brought forward from my old blog

When NAV2009 was released, a new variable type was introduced called page.

As most of you know, page and form numbers are transparent in NAV. This means that every page should have a form and vice versa. Depending of the client it will show the page or form with that number.

For example:

The table 21, customer ledger entry has a DrillDownFormID. This refers to form 25. But if you drilldown in the Role Tailored Client it will show page 25.

I’ve created a new Table with a Form and a Page, both with number 70000.

Let’s add these objects as variable to an object. Let’s do this on a page (9060 – SO Processor Activities).

When we push the actions from the role center we see that the results are exactly the same.

But when you run a page variable from the classic client it returns an error…

Lessons learned:

1. Always keep formnumbers and pagenumbers the same

2. Always use the form variable unless you want to create a specific exeption and you know what you are doing.