Reports ForNAV uses the add-in feature on Microsoft Dynamics NAV. This feature enables you to add functionality to your NAV installation via DLL files. The add-in feature in NAV supports DLL files on both the client and the server. Since NAV 2015 the server can automatically send required DLL files from the server to the client, when the client needs a specific DLL.
In our experience this works most of the time but there are minor glitches were we need to help NAV keep track of updated DLL files. When it fails to detect an update, you can get strange error messages.
Here are some of the things you can do to make sure that NAV uses the right version of the DLL.
Reload DLLs on the Server
When the service tier loads a DLL it does not unload it until it is stopped. This means that if you update the DLL file while the service tier is running, you may need to restart the service tier service.
The service tier can be restarted from the Dynamics NAV Administration or the service management in the control panel. You can launch the service manager by pressing Windows+R and enter services.msc.
Clear the client’s DLL cache
When the server sends the client an add-in DLL, the client will store it in the folder for temporary files on the client. If you suspect that the client has a wrong version of the DLL, you can clear the cache on the client and thereby force the server to send the DLL again.
Clear the client’s Add-in folder
A NAV client will look for an add-in in the client’s local add-in folder before it asks the server for it. If you remove it from the client’s add-in folder, you will make sure you get the version from the server. The default location for the client add-in is C:\Program Files (x86)\Microsoft Dynamics NAV\90\RoleTailored Client\Add-ins. The folder is for NAV 2016 on a computer with an English operating system.
Read more about clearing the client add-in cache here.
Recompile your object
If you see errors regarding type conversion or missing parameters then it is recommended that you mark all your report objects and recompile them. This will make NAV update an internal map of the methods and properties in the Reports ForNAV DLL. Mapping errors will occur if you run a mix of report objects compiled with different versions of the DLL.
IMPORTANT: You must compile ALL your ForNAV reports. If one of your reports is not compiled against the newest ForNAV add-in DLL then it can mess with the function table that NAV keeps for each DLL.
Duplicate DLL files
When NAV looks for an add-in DLL, which is used in a C/AL variable it will search the entire folder structure under the add-in folder. We have seen some instances where the administrator saves an old version of the DLL in a backup folder under the normal add-in folder. It is often considered good practice to keep a backup of the old file when you install an upgrade. Just make sure that the backup is stored outside the add-in folder and subfolders of that. Otherwise, it can be found and loaded instead of the updated DLL.
Reset your meta data for the object
For unknown reasons the meta data about the object can be invalid on the server. In this case you need to rebuild the meta data for the object on the server. One way of doing this is to export your object as text. Delete the original object. Create a new dummy object with the same name and save and compile it. As the last step, you import your previously exported text object and compile it. It is our experience that the meta data for the object is recreated if you follow this procedure.
Pingback: A call to ForNav.Report.MethodName failed - ForNAV