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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 03.04.2007, 23:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
casperkamal: A small addition to creation of Table throug x++ code in Dynamics Ax
Источник: http://casperkamal.spaces.live.com/B...CD63!261.entry
==============

 
 
   A small addition to my entry on Adding a Table field through X++ code in Dynamics Ax
 
 
      I was actually using map's and structures to set the properties for the field type. There is also an alternative way of setting it throug the Global::setproperty method....
 
 
  Global::setProperty(str properties, str propertyname, str value) 
 
 I have rewritten the job based on that.......
 
static void JobCreateTableFields(Args _args)
{
   
#AOT
    #TreeNodeSysNodeType
    //find the Table
   
TreeNode                   tablenode = TreeNode::findNode(#TablesPath).AOTfindChild('LedgerTable');
    TreeNode                   fieldNode, tn;
    Struct                         properties;
    Struct                         propertyInfo;
    Array                          propertyArray;
    str                               propertyValue;
   
AOTTableFieldList    lst;
    str                               name;
    Counter                     propertyCount;
    int                               i;
    Map                            map = new Map(Types::String, Types::String);

    ;
 
    //Find the tables field node
   
lst = tablenode.AOTfindChild('fields');
    //add the field
    lst.addString('Test');
    //now find the node in the tree
    fieldNode  =  lst.AOTfindChild('Test');

   
    //can be used when we requried to set a fewer properties
 
    fieldNode.AOTsetProperties(setProperty(fieldNode.AOTgetProperties(), 'Label', 'TestField'));
 

    //save the treenode
    tablenode.AOTsave();
   
   
//Let us open the table
    //and see if the code works :)
    tablenode.AOTnewWindow();

 
 
.............................


Источник: http://casperkamal.spaces.live.com/B...CD63!261.entry
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
casperkamal: Using record templates in code for Dynamics Ax 4.0. Blog bot DAX Blogs 0 10.05.2008 19:14
Inside Dynamics AX 4.0: Usage Scenarios Blog bot DAX Blogs 0 04.10.2007 05:15
Inside Dynamics AX 4.0: Inside the Business Connector Blog bot DAX Blogs 0 04.10.2007 05:15
casperkamal: Adding a Table field through X++ code in Dynamics Ax Blog bot DAX Blogs 1 02.04.2007 17:05

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

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

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