Kine’s Info

Info about NAV

DynamicsNAV protocol handler

Now, when NAV 2013 beta was released, many partners could struggle from the problem of side-by-side installation of the NAV clients. Problem is, that the development environment is using the URI (hyperlinks) to open the objects in RTC. Because the protocol is handled by default only the latest installed version, you can have problem if you need to use it with more versions. And because that, I have created this handler for you.

Download

NVR_DynamicsNAVProtocolHandler

After you copy the files somewhere and run the exe, you can activate the handler. Since that, instead the RTC my app will be started for each opened URI. The app will try to find correct version of RTC to run. This could be a problematic, but if you open the URI directly from active classic client, it should work. If you run the hyperlink e.g. from “Run” dialog of windows, the default RTC will be used (there is no way yet to check version of the target NST I know). If you have some tip how to check that…

 

Have a fun with NAV!

May 18th, 2012 Posted by kine | Dynamics NAV, NAV 2009, NAV 2009 R2, NAV 2009 R2, NAV 2013, NAV 2013 | no comments

Microsoft Dynamics NAV 2013 beta–installation and configuration tips

If you are installing Microsoft Dynamics NAV 2013 beta, you can struggle from some problems. There are some tips for you:

Ports

If you are installing the NAV server on computer, where are already some NAV services, you need to use different ports for the NAV 2013 services. NAV 2013 beta is not supporting Port Sharing. You need to think on it when configuring the installation.

Function not supported

When you successfully installed the NAV 2013 client with development environment on PC, where the NAV 2009 is already installed, you can have problems when you try to run something from the devenv. Instead starting the RTC client, you will see error that “Function not supported”. Weird on first sight could be, that you see the error e.g. in your local language, even you have installed the W1 version of NAV 2013. Problem is, that the devenv is using the protocol DYNAMICSNAV to run the RTC. On my PC the NAV 2013 installation have not changed the path for this protocol. You need to check the registry path “HKEY_CLASSES_ROOT\DYNAMICSNAV\Shell\Open\Command” and look if there is NAV 2013 path or not.

You can deduct from this, that coexistence of NAV 2009 and NAV 2013 will be problem. Running page from NAV 2009 classic client will run NAV 2013 RTC after this, or NAV 2013 devenv will start NAV 2009 RTC if not changed. You can decide what will suit you most. But one info: to run the table from NAV 2013 devenv, NAV need to run the RTC, In general, NAV 2013 devenv is more linked to the RTC. I expect that most of you will want to run NAV 2013 RTC through the DYNAMICSNAV protocol. It is question of time till someone will develop some tool which will correctly decide what to run… ;-)

NavUserPassword authentication

Because the Domain groups are not working in the NAV 2013 beta, it could be a problem to add all the users into NAV. You can decide to use the new authentication model “NavUserPassword”, where you create login and password directly in NAV without connection to Active Directory, which you can then share with the users to provide the “demo” access. BUT! It is not so simple. You need to go through few steps:

  1. Change the NST settings – you need to change the ClientServicesCredentialType to NavUserPassword instead the default Windows value.
  2. Create certificate – to be able to login by user name and password, NAV need to crypt the transport. For this, he need certificate. You can create self-signed certificate by using commands mentioned in the .config file:makecert -n “CN=YourServiceNameOrURL” -r -sky exchange -sv YourFileName.pvk YourFileName.cer
    pvk2pfx -pvk YourFileName.pvk -spc YourFileName.cer -pfx YourFileName.pfx
    certutil -importpfx YourFileName.pfx
    Where to take the makecert and pvk2pfx tools? You can take them e.g. from Windows SDK.
  3. Enter the certificate thumbprint into the config – first, you need to look at the Thumbprint on the generated certificat. Open it, find the field thumbprint, remove the spaces and the value enter into ClientServicesCertificateThumbprint key in the config of NST.
  4. Change the RTC authentication type – in the file c:\Users\<loginname>\AppData\Roaming\Microsoft\Microsoft Dynamics NAV\70\ClientUserSettings.config change the settings named ClientServicesCredentialType to same value as in step 1.
  5. Make the client to trust the certificate – import the certificate to the client PC, to trust it. Or you can disable the check by changing value ClientServicesCertificateValidationEnabled in the config.
  6. After all this, you can still have problem to run the NST service. In event log you can see error with error like “no access to the keys” or something similar. It means that the NST service have not enough permissions to read the certificate keys. Try to run it as admin. It should work. Quick fix is to add permissions for the service account on folder c:\ProgramData\Microsoft\Crypto\RSA\MachineKeys\.

Installation of NAV 2009 when compiling objects

After you install NAV 2013, you can have problems with compiling objects with older version of NAV like NAV 2009. When you start compile some object which use automation variable, it will start NAV 2009 installer and will try to repair the installation. It is because registry info about NAV help libraries like NTimer.dll, NSAppHandler.dll etc. were changed. You can repair it by unregistering and reregistering the dlls. I have created batch for this. You can use it (it is designed for 64bit systems). Just create file with this text, save it as .cmd file and run it as admin:

——————

regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\OLHandler\OLHandler.dll" /u /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Application Handler\NSAppHandler.dll" /u /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Commerce Gateway Client\CGReqClient.dll" /u /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Commerce Gateway Client\CGTimer.dll" /u /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Communication Component\NPipeBusAdapter.dll" /u /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Communication Component\NSComCom2.dll" /u /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Communication Component\SocketBusAdapter.dll" /u /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Communication Component\MSMQBusAdapter.dll" /u /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Timer\NTimer.dll" /u /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\NatHash\NATHash.dll" /u /s
regsvr32 "c:\Windows\SysWOW64\comdlg32.ocx" /u /s

regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\OLHandler\OLHandler.dll" /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Application Handler\NSAppHandler.dll" /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Commerce Gateway Client\CGReqClient.dll" /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Commerce Gateway Client\CGTimer.dll" /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Communication Component\NPipeBusAdapter.dll" /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Communication Component\NSComCom2.dll" /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Communication Component\SocketBusAdapter.dll" /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Communication Component\MSMQBusAdapter.dll" /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\Timer\NTimer.dll" /s
regsvr32 "c:\Program Files (x86)\Common Files\Microsoft Dynamics NAV\NatHash\NATHash.dll" /s
regsvr32 "c:\Windows\SysWOW64\comdlg32.ocx" /S

——————
This will do it for you. I am not sure if it is just my local problem or it is because NAV 2013 was installed side-by-side with NAV 2009. If you hit this problem, it should help you…

May 17th, 2012 Posted by kine | Dynamics NAV, NAV 2013 | 2 comments

NAV 2013 beta–What’s new

It is time to look at new features in NAV 2013 C/Side. This will be quick overlook of new commands and functionality in the developers environment, which is replacement of the classic client and is intended only for developing now.

New commands

[Ok :=] xRec.SETAUTOCALCFIELDS([Field1] ,…)[Ok :=] xRec.SETAUTOCALCFIELDS([Field1] ,…)

Using this command you tell NAV to automatically calc the FlowFields after new record is read into the variable. You do not need to call CALCFIELDS in the repeat-until loop now and the fields will be calculated in one step with the reading the data.

[SecurityFiltering :=] xRec.SECURITYFILTERING([SecurityFiltering])

The security filter model was changed in NAV 2013 and I hope that it will be much more usable now. Through this command you can set different modes:

  • Filtered – The security filters are applied to the record. Records outside the filter are unvisible for the user and for the code it looks like there are no other records.
  • Validated – Similar to Filtered but if you try access record outside the filter, you will get error. This mode is similar to the pre NAV 2013 behavior and have impact to performance.
  • Ignored – The security filters are ignored for this record variable.
  • Disallowed – If there is some security filter set on the table, it will lead to the error. It means, you can use it in process, where you want to be sure, that it is running by user, which have no security filters set on the table.

For more info I recommend to read the C/Side help topic “Security Filter Modes”.

Keys

If you run the Symbol menu, you can find out that there is new group of command for each record variable, just under the “Functions” group. In this Keys group you can select existing keys and insert it into the code. No more manual entry of keys in NAV 2013!

Type := GETDOTNETTYPE(Expression)

This command will help you when using DotNet interop. It will return you the type object for the selected assembly. In NAV 2009 you needed to use workarounds to get the type.

Ok := CANLOADTYPE(DotNet)

Before you use some assembly, you can test if you can use it. Could help you when you are not sure, if the assembly is installed.

String := CAPTIONCLASSTRANSLATE(CaptionClassText)

Function will translate the caption class. It is using new function in CU1 with ID 15.

[IsActive :=] CODECOVERAGELOG([NewIsActive] [, MultiSession])

This old command have new parameter – MultiSession. It looks like now you can use codecoverage for all sessions…

CODECOVERAGEINCLUDE(ObjectRecord)

No more info on this, it looks like you can enable CodeCoverage only for selected object.

CODECOVERAGEREFRESH

It looks like it reread the codecoverage data.

CODECOVERAGELOAD

No info on this. May be similar to previous one…

String := GETLASTERRORCODE

New command to read the error code.

String := GETLASTERRORCALLSTACK

If there is error, you can read the call stack to be able to show more info to user or log more info somewhere.

New debugger commands

There is whole new set of commands to work with debugger. Because the new debugger is based as Page in NAV, all functions of the debugger are exposed as commands and tables within NAV. It means, if you want, you can create your own debugger in NAV!

New session commands

Classic NAS was replaced with functionality, which allows C/AL to create new sessions which are doing what you need in background. There are new three commands for this:

[{Ok} :=] STARTSESSION(SessionId, CodeunitId [, Company] [, Record])

Start new session, which will run the selected codeunit, in selected company with selected record.

ExecutionMode := CURRENTEXECUTIONMODE

Return the execution mode of the current session. The execution modes are EXECUTIONMODE::Standard or EXECUTIONMODE::Debug.

[{Ok} :=] STOPSESSION(SessionId [, Comment])

You can decide to stop previously started background session.

USID := USERSECURITYID

Will tell you the User SID. Usage? Do not know yet…

SETUSERPASSWORD(USID, Password)

If you are using NavUserPassword authentication, you can change the password for selected user through code.

CHANGEUSERPASSWORD(OldPassword, NewPassword)

If you are using NavUserPassword authentication, you can change the password of current user through this function.

ID := SESSIONID

Will return the current session ID.

ID := SERVICEINSTANCEID

Will tell you ID of your NST.

Test page functionality

There is whole new area of functionality about testing the pages. You can simulate the user actions through the new commands. Than you can run automatized tests of the UI! I recommend to read more in documentation, look at some blog articles, watch the recorded sessions about this…

Query functionality

Again, whole new area of functionality. You can use the Query object to read data through complex select statements and loop through the result in code or save it as XML or CSV file.

DotNet interop changes

You can now consume events of the DotNet assemblies (WithEvents property).

Addin changes

When you are creating addins, you can again create events which you can consume in NAV, or you can add methods, which you can call from NAV. And there is more than that. You can set the Addin behaviour lik automatic resize etc.

Conclusion

There is a LOT of new things in NAV 2013, but I am sure, that there will be LOT of blog articles in next days, because the NDA for MVPs about NAV 2013 beta was lifted. Thus, watch the blogs of my fellow MVP friends for more info…

As you can see, NAV 2013 is really big jump, may be bigger than NAV 5 to NAV 2009 jump.

May 17th, 2012 Posted by kine | Dynamics NAV, NAV 2013 | no comments