export Nav. object programmatically

charles.roos
Member Posts: 60
Hi,
Can i programmatically export Navision object?
The functionality should open File-Save dialog and ask for exported file name, and then export the object to the local hard drive, all this should be done programmatically, ala:
Nav.OpenExportDialog(objID, '*.txt');
FileName := nav.GetExportedObjectFilePath;
//read file in location "FileName"
Or if possible then File-Save dialog shouldn't be shown at all if possible.
The solution would be a form with a button and if user presses the button the exporting would be done.
Can such functionality be done at all?
Can i programmatically export Navision object?
The functionality should open File-Save dialog and ask for exported file name, and then export the object to the local hard drive, all this should be done programmatically, ala:
Nav.OpenExportDialog(objID, '*.txt');
FileName := nav.GetExportedObjectFilePath;
//read file in location "FileName"
Or if possible then File-Save dialog shouldn't be shown at all if possible.
The solution would be a form with a button and if user presses the button the exporting would be done.
Can such functionality be done at all?
0
Comments
-
In NAV 5.00SP1 you can use the ExportFOB and ImportFOB from C/Fornt for that. And you can use the C/Front inside NAV... :-) but just only as FOB...0
-
Thx for your relpies.
I see that one should use this object to create programmatical key presses in Navision client:
"Windows Script Host Object Model.WshShell"
This should solve what i need, thx you both.0 -
You can also export the BLOB in the object-table to a file. In another DB, you can import them in the same way. But you need to maintain the values of the fields (ID,Name,Version-list,date,time) in the object-table yourself.
If you export it in this way, you CANNOT import the object with the File=>Import-function. I did something like this in 3.01 with the NAS for replicating objects from 1 DB to another.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
kine wrote:In NAV 5.00SP1 you can use the ExportFOB and ImportFOB from C/Fornt for that. And you can use the C/Front inside NAV... :-) but just only as FOB...
I've build a wrapper dll for the Cfrontdotnet....it works fine calling it from NAV but when I give the command to CloseDatabase(), NAV crashes....if I comment the closedatabase the dll doesn't give the error but when I close NAV then again NAV crashes.....
ANY idea why this is happening???????????????? ](*,) ](*,) ](*,) ](*,) ](*,) ](*,)Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
Noone has tried to do this? ](*,) ](*,)Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
Isn't this what you are looking for?
http://www.codeproject.com/KB/library/AutoupateNAV.aspx?display=Print
The only difference it seems that it is in C#.CA Sandeep Singla
http://ssdynamics.co.in0 -
Thanks but that can only export/import as txt (which the tool in my signature is doing...) not as FOB which is why I'm using C/FRONT...
What I've done is I've built a DLL in C# that I'm calling from NAV to Export objects as fob files....
it works fine but sometimes it crashes NAV...and I discovered that crashes NAV when I close the database with CloseDatabase();
This is the code:public bool ExportFob(string NAV_path,string servername,string databasename,string export_fob_filename_path,string export_filters,ref string error_msg) { CFrontDotNet.DriverType = NavisionDriverType.Sql; CFrontDotNet.NavisionPath = NAV_path; CFrontDotNet.HideErrors = true; CFrontDotNet nav_instance = new CFrontDotNet(); try { nav_instance.ConnectServerAndOpenDatabase(servername, NavisionNetType.SqlDefault, databasename, 2000,false, true, "", ""); nav_instance.ExportFOB(@export_fob_filename_path, export_filters); [color=#FF0000] This line crashes NAV if I comment it works fine but then NAV crashes when I close NAV itself[/color] //nav_instance.CloseDatabase(); return true; } catch (Exception e) { error_msg = e.Message; return false; } } }
Anyone??? Anyone???Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=11230 -
-
kine wrote:In NAV 5.00SP1 you can use the ExportFOB and ImportFOB from C/Fornt for that. And you can use the C/Front inside NAV... :-) but just only as FOB...
I was trying to use importfob and exportfob from cfront in nav2009r2, by following the example https://msdn.microsoft.com/en-in/library/dd338953.aspx, this example is working fine, but while using importfob function in cfront, i am getting the below error for the respective codes
1)
cfront.importfob(vartext,1); //vartext is the file location 'C:\test.fob'
"This data type is not supported by C/SIDE. You can access data from
any of the following data types:
VT_VOID, VT_I2, VT_I4, VT_R4, VT_R8, VT_CY, VT_DATE, VT_BSTR and VT_BOOL"
2)
cfront.importfob(varVariant,1); //varVariant is the file location 'C:\test.fob'
This message is for C/AL programmers:
Type conversion of Text is not possible.
VT_LPWSTR was probably the target type.
I can see that problem is with finding LPWSTR equivalent datatype in nav, same is in exportfob too.
Any idea about this error?
Thanks in advance.0 -
FOB file is not compiled. To import fob using C/Side, we should have compiled FOB0
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