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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 16.01.2008, 15:00   #9  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
Kashperuk Ivan: Microsoft Dynamics AX 2009 - some of the new development features
Источник: http://kashperuk.blogspot.com/2008/0...me-of-new.html
==============

Alexei Eremenko from Microsoft Russia has posted a number of articles about the new features that will be available in DAX 2009.
The original link, which is in Russian (but the main thing to look at is the code, which is universal): http://blogs.msdn.com/aeremenk/archi...5/7118429.aspx

I would like to make a brief review of the features he talked about for the English-speaking population and another feature I liked that Alexei did not mention.

Let's start with the support for union in SQL statements (but only when using Query* classes).
X++:
    query = new Query();  
    query.queryType(QueryType::Union); // The other value of QueryType is "Join"

Another Exception type has been introduced, which now actually allows to catch the DuplicateKey exception:

X++:
   Table t;

    try   
   {      
        while select forupdate t
       {
            test.Field1 = ;
            t.update();
        }
   }
   catch ( Exception::DuplicateKeyException, t )
   {
       infolog(Record already exists -  + t.Field1 );  
   }

The bulk DML statements now allow using inner/outer joins, and you can access the result of the update_recordset operation to get the number of rows that were updated:

X++:
update_recordset batchJob setting
      Status = BatchStatus::Canceled,
      EndDateTime = thisDate,
      Finishing = 1
  where batchJob.Status == BatchStatus::Cancelling
  notexists join batch
  where (
          (batch.Status == BatchStatus::Ready ||
               batch.Status == BatchStatus::Executing ||
               batch.Status == BatchStatus::Hold ||
               batch.Status == BatchStatus::Cancelling)
          && batch.BatchJobId == batchJob.RecId
          );

  rowsUpdated = (batchJob.RowCount() > 0); // get the number of updated rows with rowCount()
And, the feature I enjoyed, is that we now have crossCompany support in X++. Meaning you can access data from tables from a number of companies in one query.
Here are code snippets to explain what I mean:

X++:
static void DataBaseAccess_CrossCompany(Args _args)
{   
    InventTable inventTable;   
    container   companyContainer = ['IN1', 'QMS'];   
    ;   
    while select crossCompany : companyContainer inventTable       
        where inventTable.ItemId == "B-R14"   
    {       
        print inventTable.ItemId, " -- ", inventTable.dataAreaId;   
    }   
    pause;
}
This code will print ItemId from 2 companies, even though InventTable has the property SaveDataPerCompany set to Yes.

The same functionality is available with the Query classes:

X++:
static void DataBaseAccess_CrossCompany_Query(Args _args)
{   
    Query                   query = new Query();   
    QueryBuildDataSource    qbds  = query.addDataSource(tableNum(InventTable));
    QueryRun                queryRun;
    InventTable             inventTable;
    ;
    qbds.addRange(fieldNum(InventTable, ItemId)).value(queryValue("B-R14"));

    query.allowCrossCompany(true);
    query.addCompanyRange("IN1");
    query.addCompanyRange("QMS");

    queryRun = new QueryRun(query);
    while (queryRun.next())
    {
        inventTable = queryRun.get(tableNum(InventTable));
        print inventTable.ItemId, " -- ", inventTable.dataAreaId;
    }
    pause;
}

If you don't add any specific company ranges, the data will be retrieved from all companies you have access to.

Microsoft Dynamics AX 2009 has a lot more to offer, of course. But enough for today.

Источник: http://kashperuk.blogspot.com/2008/0...me-of-new.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
Теги
ax2009, что нового

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Dynamics AX: Why upgrade to SQL Server 2008 with DAX 2009? Blog bot DAX Blogs 0 16.10.2008 06:24
msdynamicsax: DAX 2009 and MS SQL 2008 Blog bot DAX Blogs 0 09.08.2008 14:05
aEremenko: Тестирование производительности в DAX 4.0 Blog bot DAX Blogs 0 12.03.2008 16:05
aEremenko: Что нового в Microsoft Dynamics AX 2008? Blog bot DAX Blogs 6 15.01.2008 11:36
aEremenko: Поддержка Microsoft SQL Server 2008 Blog bot DAX Blogs 0 04.10.2007 23:21

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

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

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