How to exportobjects to txt file automatically

Rafal07BC
Member Posts: 5
Hello everyone,
I would like to exportobjects to txt file automatically for source code version control in Nav 2013.
Unfortunately calling exportobjects function in codeunit fails with error that it is not supported.
Other method i see is using command=exportobjects command line argument in finsql.exe.
Unfortunately i am struggling to use this because of the license problem.
I want to use this export on production environment and this means that database has loaded customer license without the permission to export to text. I cant find a way to force finsql to use different license (developer license ) provided in the file.
I tried putting it in services folder under fin.flf name but still it fails.
Do you have any ideas how i can achieve this?
I would like to exportobjects to txt file automatically for source code version control in Nav 2013.
Unfortunately calling exportobjects function in codeunit fails with error that it is not supported.
Other method i see is using command=exportobjects command line argument in finsql.exe.
Unfortunately i am struggling to use this because of the license problem.
I want to use this export on production environment and this means that database has loaded customer license without the permission to export to text. I cant find a way to force finsql to use different license (developer license ) provided in the file.
I tried putting it in services folder under fin.flf name but still it fails.
Do you have any ideas how i can achieve this?
0
Comments
-
Don't know if you can use it, but here is a codeunit I wrote.
OBJECT Codeunit 50000 expalt
{
OBJECT-PROPERTIES
{
Date=19-04-13;
Time=10:17:28;
Modified=Yes;
Version List=;
}
PROPERTIES
{
OnRun=BEGIN
NavisionPath := 'C:\Program Files (x86)\Microsoft Dynamics NAV\70\RoleTailored Client\';
servername := 'CD-02-TST\NAVDEMO';
databasevar := 'Demo Database NAV (7-0)';
Path := 'c:\navSource\';
AllObj.SETFILTER("Object Type", '<>%1&<>%2', AllObj."Object Type"::TableData, AllObj."Object Type"::System);
IF AllObj.FINDSET THEN BEGIN
fil.TEXTMODE(TRUE);
fil.CREATE('c:\Export.tmp');
fil.WRITE('@echo off');
fil.WRITE('@echo Exporting...');
fil.WRITE('if exist ' + Path + ' (');
fil.WRITE('rd /s /q ' + Path);
fil.WRITE(')');
fil.WRITE('md ' + Path);
fil.WRITE('cd ' + NavisionPath);
REPEAT
filnavn := CONVERTSTR(AllObj."Object Name", '/&,','___');
cmd :=
'finsql.exe command=exportobjects, file=' +
Path + filnavn + '-' + FORMAT(AllObj."Object ID") +
'.' + FORMAT(AllObj."Object Type") +
'.txt, servername=' + servername + ', database="' + databasevar + '", filter="Type=' +
FORMAT(AllObj."Object Type") + ';ID=' + FORMAT(AllObj."Object ID") +
'", logfile=' + Path + 'fejl.txt';
fil.WRITE(cmd);
fil.WRITE('if exist ' + Path + 'fejl.txt (');
fil.WRITE('type ' + Path + 'fejl.txt');
fil.WRITE(')');
UNTIL AllObj.NEXT = 0;
fil.WRITE('@echo Exporting Finished');
fil.WRITE('pause');
fil.CLOSE;
END;
END;
}
CODE
{
VAR
AllObj@1161027000 : Record 2000000038;
Path@1161027001 : Text[250];
cmd@1161027002 : Text[250];
fil@1161027004 : File;
filnavn@1161027003 : Text[250];
servername@1161027005 : Text[250];
databasevar@1161027006 : Text[250];
NavisionPath@1161027007 : Text[250];
BEGIN
END.
}
}
0
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