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...
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.
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
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...
Last week I created my first RTC report. An exiting experience I can say.
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.
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.
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.