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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 19.04.2008, 13:08   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
This post describes how you can automate importing and exporting of Microsoft Dynamics NAV objects with C/Front.





To make a basic C/Front project, see the post Beginners guide: How connect to NAV from a .net project, using C/Front. This post only describes the additional code needed to import or export NAV objects.





Exporting objects:


The line below will export Tables 1..10 to the file "C:xExportFob.fob":


CFrontDotNet
.Instance.ExportFOB("C:xExportFob.fob","WHERE(Type=CONST(Table),ID=FILTER(1..10))");


The filter has to be in the same syntax as used in the "DataItemTableView" in a report. The simplest way to create the filter is to make a new report in NAV, based on the Object Table. Then in the DataItem Properties, specify a filter in DataItemTableView, and copy that into your C/Front code.


The file that you export is a normal .fob file, which can be imported back in the usual way (File -> Import from Object Designer), or via C/Front as described next.


Importing objects:


C/Front has a special datatype "NavisionImportMode" to control the actions when the objects you import conflict with existing objects. The possible settings are Overwrite, Skip and ThrowError. The code needed to re-import the object we exported before, is:


NavisionImportMode ImportMode;


ImportMode =
NavisionImportMode.Overwrite;


CFrontDotNet.Instance.ImportFOB("C:xExportFob.fob",ImportMode);





Comments:


You can only export objects as binary .fob files. It is not possible to export objects as text.


In SP1 for NAV version 5, C/Front will no longer check for license permissions when importing files. So the import-functionality works just like importing objects manually, which means that the license file is not checked. In previous versions it was not possible to import new objects or tables with new fields unless the NAV license would allow the user to create those objects or fields manually.








Lars Lohndorf-Larsen


Microsoft Dynamics UK



Microsoft Customer Service and Support (CSS) EMEA


These postings are provided "AS IS" with no warranties and confer no rights. You assume all risk for your use.



Читать дальше
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 


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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 21:30.