AXForum  
Вернуться   AXForum > Microsoft Dynamics NAV > NAV: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 16.08.2017, 17:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,607 / 848 (80) +++++++
Регистрация: 28.10.2006
sp-nav-tech: Export and Split Navision objects using Windows PowerShell in NAV 2015
Источник: http://sp-nav-tech.blogspot.com/2016...cts-using.html
==============

We are following some simple steps for export the Nav application objects:

1. Open Windows PowerShell ISE and Load Nav Development Shell Command.
In Start Menu Just search Windows PowerShell ISE and open it.
Now you will see below screen.












Now to load Nav development shell command into Windows PowerShell ISE just run below command then you access all function and command which are available in Microsoft.Dynamics.Nav.Model.Tools.Module.

Command :- Import-Module “C:\Program Files (x86)\Microsoft Dynamics NAV\80\RoleTailored Client\Microsoft.Dynamics.Nav.Model.Tools.psd1" -force







Run its command by using Run Scipt(F5) {Tools - Run/Continue}.

Now we will see how to Export and Split Nav Objects.

2 Export Nav Object using Windows PowerShell.

We used below cmdlet for export.
Command - Export-NAVApplicationObject

Syntax - Export-NAVApplicationObject FilePathwithName -DatabaseServer 'ServerName' -DatabaseName 'DatabaseName' -Filter filters -LogPath 'Log File Path'

FilePathWithName - The path and file name to which you export objects. This parameter is required.
Exp - D:\SP\Source\Tables.txt

ServerName :- The Name of the database server on which you want to run the command.
Exp:- dell-pc (Localhost)

DatabaseName :- The database in which the objects that you want to export.

filters :- A filter on the Objects Table. following table shows the fields in the objects table on which you can filter,

Object table field
Values
Example
Type
Table, Codeunit, Page, Report, XMLport, Query
Type=Table|Page
ID
Integer or range of integers
ID=60000..60010
Name
Any valid object name
"Name=Purchase Header"
Modified
yes, no, 1, 0
Modified=yes
Compiled
yes, no, 1, 0
Compiled=0
Date
Date, in the numeric format determined by your regional settings
"Date=01/12/2012"
Time
Time, in the numeric format determined by your regional settings
"Time=12:00:00"
Version List
Any valid version
"Version List=NAVW17.00"
Caption
Any valid caption
"Caption=Company Information"
Locked
Yes, no, 1, 0
Locked=1
Locked By
Domain\username
"Locked By=dell-PC\sonu.panwar"

Log File Path :- The path for the file that contain error messages that result from the command, if there are no error come at run time then log file not created.
By Default, the file named naverrolog.txt and is located in same location as finsql.exe.

Example:-
Now run the below command for export objects form specified Database.

Export-NAVApplicationObject D:\SP\Source\test\Table.txt -DatabaseServer 'dell-pc' -DatabaseName 'ePuma-LocalDev' -Filter 'Type=Table;ID=1..10' -LogPath 'D:\SP\Source\test\' | Split-NAVApplicationObjectFile -Destination D:\SP\Dest\



After run it command show the below screen.








Now can check specified path "D:\SP\Source\test\" in command then you found a txt file with specified name (Table.exe)








3- Split

Splits a text file that contain two or more objects into separate text file for each objects

Syntax

Split-NAVApplicationObjectFle [-Source] [[-Destiation] ] [-Force] [-PassThru][-PreserveFormatting]

Use that command to split a text file that contains more then 2 Nav application Objects into separate text file for Nav application objects. for example if you are export table 36 and table 37 to a single text file such as Table.txt., you can use the split command to create separate text file like as TAB36.txt and TAB37.txt.

---------
Now we want to export the some filtered objects with the separate txt file, then we can use the both command with "|".
Export Comand |Split Command
Syntax
.- Export-NAVApplicationObject FilePathwithName -DatabaseServer 'ServerName' -DatabaseName 'DatabaseName' -Filter filters | Split-NAVApplicationObjectFle [[-Destiation] ]


It's command first export the objects in source location and after then splits and save in destination Location.

Example - Now we want to export Tables 1 to 10 with separate txt file.

Command-
Export-NAVApplicationObject D:\SP\Source\test\Table.txt -DatabaseServer 'dell-pc' -DatabaseName 'ePuma-LocalDev' -Filter 'Type=Table;ID=1..10' -LogPath 'D:\SP\Source\test\' | Split-NAVApplicationObjectFile -Destination D:\SP\Dest\











come the below message after successfully run the command.













Now check you source path and destination path now created the Table.txt at source path and separate file are created at destination path.























Thank You.





Источник: http://sp-nav-tech.blogspot.com/2016...cts-using.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Export NAV Application Objects Blog bot Dynamics CRM: Blogs 0 11.03.2016 03:01
NAV Team: Coffee Break - Search in a Dynamics NAV object file using Windows PowerShell Blog bot Dynamics CRM: Blogs 0 27.02.2015 14:00
NAV Team: Merging Application Objects using Windows PowerShell in Microsoft Dynamics NAV 2015 Blog bot Dynamics CRM: Blogs 0 03.10.2014 14:30
NAV Team: Merging Application Objects using Windows PowerShell Blog bot Dynamics CRM: Blogs 0 07.07.2014 18:30
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 13:26.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.