« February 2009 | Main | April 2009 »

How can I create a Link in an email that opens a specific page in the Role Tailored Client?

In the Classic Client for Dynamics NAV, and in older versions (4.X, 5.x) when creating emails from C/AL code, we had the possibility to use the Form.URL method and include it into the body of an email. Whenever someone then clicked on the Link, the Classical Client would be opened and the corresponding Form was shown.

In Dynamics NAV 2009, in the Role Tailored Client, the Form.URL method is no longer supported. The RTC does not display Forms, it uses Pages and Pages do not have an URL method.

So, how can we then create a Link towards a specific Page?

To solve this, you have to create the URL as follows: dynamicsnav:////runpage?page=<Page No>&bookmark=<URL>.

But how can we get the BookmarkURL for a specific Page?

Well, what you need to do is use a RecordRef variable that points towards the specific Page and use its RecordId property. The problem might then be that your code is in a Codeunit and can sometimes be called from within a Form or from within a Page. How can you make your code compatible with both environments?

To solve these kinds of issues, in C/AL there's a new function available: ISSERVICETIER:

  • If you call ISSERVICETIER from the Classic client, then the function returns false.
  • If you call ISSERVICETIER from the RoleTailored client, then the function returns true.

This allows you to execute different code that is based on the client that you are running.

Here's an example of how you can write your code, to be compliant with the Classical Client and the Role Tailored Client:

Keep in mind that in the past (before Dynamics NAV 5.0 and 2009) you could use the"Mail" Codeunit to create and send emails. As from Dynamics NAV 5 and 2009 it is also possible to use SMTP (Codeunit "SMTP Mail") to do this.

In the code example above I used a Mail Codeunit variable to send mail in the Classic Client and I used SMTP for the Role Tailored Client. But of course you can also use SMTP from within the Classical Client.

Get trained

120x240-training - kopie 

a CEO was debating a training initiative for his company, someone asked him :

  "What if you train everyone and they all leave?"

 

He responded:

  What if we don't train them and they all stay?

How can I see Notes in the Dynamics NAV 2009 Classic Sql Client?

In the Role Tailored Client you have a new functionality to use called Notes. Note work very similar to Comments in the Classic Client. For example, you open a Customer Card in the RTC and then create a Note for that Customer like this:

But the problem is that these notes created in the Role Tailored Client are not accessible via the Classic Client. So if you are working in Mixed Mode, meaning using the Classic Client and the Role Tailored Client on the same Sql Server database, then notes created via the RTC cannot be displayed in the Classic Client.

How can we make these Notes accessible via the Classic Client?

Well, you are probably thinking, no problem, just create a form around the Notes table and link it to for example the customer card. Well, that's not possible, because there's no Notes table. So the question is where are these Notes stored in the database? After a little research I found that Notes are stored in the Record Link table. This table is used to store Record Links, and now this table has been redesigned to also store Notes:

So, now we know where to find Notes in the database, so now you should be able to also visualize Notes in the Classic Client.

How can you now visualize a Note?

Well, the Note is saved as a BLOB field in the table, so you can for example export it to a Text file and then view it.

Example Form:

And the code behind the View Note button could be this:

 

 

Reporting Services Tip about using the user's regional settings.

When creating Sql Server Reporting Services Reports you can sometimes end-up with data in US format instead of the local regional settings of the user.

For Example:

Here we have a report showing the Sales LCY and Profit LCY by Salesperson and Country in a matrix control. The data is coming from the Dynamics-NAV Sql database, but the formatting of the amounts is in US format, even when the report is running on a system that has Belgium regional settings.

How can we correct this?

Well there's a simple solution for this common problem. In the Report Designer in Visual Studio, the report has a LANGUAGE property:

By default this will contain English (United States), but by changing it to an expression you can make it dependant on the users Regional Settings:

Select <Expression>, then the Expression Editor opens. Then type in =User!Language

Run the report again to see the result:

Then Report will recognize user client's culture settings, e.g. Internet Explorer's languages settings.

top
October 2011
Mon Tue Wed Thu Fri Sat Sun
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
bottom
top
bottom





powered by FreeFind
© 2005 Plataan bvba | [email protected]