Navision Automation library v1.0

Administrator
Member, Moderator, Administrator Posts: 2,506
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.
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.
0
Comments
-
To use this library first use:
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 Object0 -
Nice Automation Dick!
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))
---0 -
This powershell script can be used to iterate over table 2000000038 and export all code objects:
$na = new-object -com NavisionAutomation.1 $rot = $na.RunningObjectTable $objectdesigner = $rot.ObjectDesigner(1) $enum = $rot.AppBase(1).GetTable(2000000038).EnumRecords while ($rec = $enum.NextRecord()) { $objecttype = $rec.GetFieldValue(1) $object = $rec.GetFieldValue(3) if ($objecttype -eq 5) { $strm = $objectdesigner.ReadObject($objecttype, $object) $strm.Seek(0,0) $buf = $strm.Read($strm.Size()) $m = [regex]::matches($buf, "^OBJECT (Codeunit) ([0-9]*) (.*)") if ($m[0].Groups[1].Value -eq "Codeunit") { $filename = "C" } $filename += $m[0].Groups[2].Value $filename += $m[0].Groups[3].Value $filename += ".nav" Write-Output $filename Write-Output $buf | Out-File $filename break } }
0 -
Hi all,
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.0 -
Solved. The dll should be build with target platform x860
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions