Navision Automation library v1.0
Navision Automation library to use IObjectDesigner, IAppBase, IHyperLink monikers (from RunningObjectTable).
This library can be used to import/export objects, access data and open hyperlinks from any application (JavaScript/PowerShell/Python/VBScript/VB etc)
http://www.mibuso.com/dlinfo.asp?FileID=1193
Discuss this download here.
Comments
regsvr32 navisionautomation.dll
Then you can use (i.e.) Power Shell to access navision:
C:\> $na = new-object -com NavisionAutomation.1
C:\> $rot = $na.RunningObjectTable
C:\> $rot.names
lists all instances
C:\> $objectdesigner = $rot.ObjectDesigner(1)
get objectdesigner instance (index 1 in runningobjecttable)
C:\> $strm = $objectdesigner.ReadObject(1,18)
get stream for table (=1) object (=18)
C:\> $strm.seek(0,0)
Start at position 0
C:\> $strm.Read($strm.Size())
Read Object
Below an example in AutoItScript to export table 18 in text format:
--
Local $NAV_Instance = 1 ;In my case (see array $NAMES for all available innstances)
Local $lInt_ObjectType = 1 ;1=Table, 2=Form, 3=Report, 4=Dataport, 5=Codeunit, 6=XMLPort, 7=MenuSuitem 8=Page
Local $lInt_ObjectID = 18 ;Table 18 = Customer
$NAV = ObjCreate("NavisionAutomation.1")
$ROT = $NAV.RunningObjectTable
$NAMES = $ROT.names
$OD = $rot.ObjectDesigner($NAV_Instance)
$strm = $OD.ReadObject($lInt_ObjectType,$lInt_ObjectID)
$strm.Seek(0,0)
$size = $strm.Size
ConsoleWrite($strm.Read($size))
---
Bart van Beek
Boltrics Professionals B.V. | www.boltrics.nl
Nekovri Dynamics | 3PL Dynamics
I'm getting an error below (platform Windows 7 x64):
PS C:\> $na = new-object -com NavisionAutomation.1
New-Object : Retrieving the COM class factory for component with CLSID {B1099FD9-F00F-4F42-8C16-C5
e to the following error: 80040154.
At line:1 char:17
+ $na = new-object <<<< -com NavisionAutomation.1
+ CategoryInfo : ResourceUnavailable: (:) [New-Object], COMException
+ FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Commands.NewObjectCommand
I've registered dll by executing regsvr32 d:\Projects\UpgradeTimeEstimation\navisionautomation.dll. So what am I doing wrong? Please assist me.