i am doing an upgrade from NAV2013r2 to NAV2018.
In the old version, I’ve created a codeunit to manage different connection for an integration with a delivery enterprise. For this, in the procedures of the codeunit, exist different automation variables. In the old server, work perfect, but when I’0m trying o compile this CodeUbnit in NAV2018, in a new server, I get this error:
“Cannot obtain information of the type library
The type library could be damaged or has an invalid format.
Try to register again OLE control or the Automation server”
If you need to use XML, it’s best using DotNet. You can see how to use it (it’s very similar to automation) in codeunit 6224 “XML DOM Management”, and, if you can, use this “library” to read or write XML documents.
DotNet can run on server, and this is best if you want to use web services or automated tasks through job queue.
Thank you for your answer. Thath could be a solution, but it will be quite a harde job, becasue the codunit is working perfectly, and that solution will extend the upgrade process…
If there is not other solution, i will work on it, but I prefer not to change the CU if it’s possible…
You need to register it, so that NAV can see it. If it worked with NAV 2013 R2, then it may work in NAV 2018 too.
But Ponc is right. I would use the dot.net XML component, much better than the old XML ole automation.
Even if it’s a big codeunit. And it’s not that difficult. Most of the “functions” you have in the automation works 1-to-1 with the similar dot.net component. Or use the the XML DOM management codeunit, then you save a lot of what you otherwise had to do “manually”.
When every you use custom automations in Navision, you should never put them into standard objects. Always create a separate CodeUnit as a wrapper. Then call the wrapper CodeUnit from your C/AL code.
The reason for this is two fold.
1/ The issue you have here would be a trivial fix, since you would only have to edit the wrapper CU, everything else would remain the same.
2/ If you need to work on the other code, you don’t need to have all those automation installed on the client you are using. So it makes it much easier to compile code and to debugg.
Ahh, normally CU in our forums is used to refer to Microsoft’s monthly cumulative updates - the CU’s. I guess you mean codeunit = CU? hehe [emoticon:c4563cd7d5574777a71c318021cbbcc8]
Yes sorry, it’s my fault! I think that it’s not hard to change the automation objects to dotnet objects. What it is more laborius, it’s to test again all the integraton with the service, now that finally is working perfectly… If there is no other option, I will do it, of course.