Categories
HOW TO Microsoft Windows 8 / 8.1

HOW TO gain access to local drives in RDP

Often when you are connected to a computer in a Remote Desktop Connection (RDP) you need to have access to your local drives or local files.

HOW TO gain access to local drives in RDP?

  1. Click Start, point to All Programs (or Programs), point to Accessories, point to Communications, and then click Remote Desktop Connection.
    Remote Desktop Connection
  2. Click Show Options and then click the Local Resources tab.
  3. Click More under Local devices and resources.
    Remote Desktop Connection - Local Resources
  4. Select the check box next to Drives (you could select some drives clicking the plus sign to show detail data) then click OK.
    Remote Desktop Connection - Choose local devices and resources
  5. Click the General tab, Type the name of the Computer and the Username (with format Domain\Username) and then click Connect.
  6. Type your Password and then click OK.

Did my HOW TO help you? Leave a reply.

Categories
Dynamics NAV HOW TO Microsoft

Working with dates in NAV

To work following the standards avoids future issues.

In this post I’d like to suggest a way to convert dates in NAV.

Working with dates in NAV

A date in your system can have different formats depending on the preferences of your country and language.

You can come across different errors, for example Server and Client with different settings or ambiguous date because valid between two different formats (e.g. 05/04/2015 that could be DD/MM/YYYY or MM/DD/YYYY)

To avoid this confusion there is an International Standard that is the standard XML format that returns the date in the following format

YYYY-MM-DD

In NAV you can use the FORMAT Function (Code, Text) with the following declaration:

String := FORMAT(Value[, Length][, FormatStr/FormatNumber])

and using the FormatStr = 9 to return a string in XML format

[sourcecode lang=”Cside”]FORMAT(varDate,0,9);[/sourcecode]

Note: Leaving the Length = 0 then the entire value is returned.

This example requires that you create the following variables:

Name DataType Subtype
varDate Date

Example:
[sourcecode lang=”Cside”]
varDate := DMY2DATE(5,4,2015);
MESSAGE(FORMAT(varDate,0,9));
[/sourcecode]

It will return
Working with dates in NAV

How to convert from a string in XML format back to a field or variable of type Date?

To convert a string in a date in NAV we need to call the EVALUATE Function with the following declaration:

[Ok :=] EVALUATE(Variable, String[, Number])

It’s interesting that also in this function we can use Number = 9 to set that the string expected will be in XML format.

Using the standard XML format you will work in accordance to the standards and the configuration of your Server or Client, language or preference in your system will not affect your work and each date will be converted always in the same manner.

Remind that you can use the same functions and logic working with DateTime.

Did my post help you? Leave a reply.