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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 20.04.2013, 09:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
axforum blogs: Как получить список таблиц с отключенным Optimistic Concurrency Control
Источник: http://axforum.info/forums/blog.php?b=399
==============

источник http://fandyax.blogspot.ru/2012/07/h...-from-aot.html
----------------------------------------------------------------
X++:
static void THK_tableOccenabledFromAOT01(Args _args)
{
    #AOT
    #properties
    TreeNode        TreeNode = TreeNode::findNode(#TablesPath);
    str             tableName;
    str             temporaryProperty;
    sysdictTable    m_dictTable;
    int             i,records,m;
    dictionary      m_dictionary = new dictionary();
    #File
    #WinAPI
    #Avifiles
    CommaIo                 commaIO;
    SysOperationProgress    sysProgress;
    fileName                fileName;
    FileIOPermission        permission;
    int                     start;
;
    if(!Box::yesNo("Are your sure lookup Occenabled table infomation?",dialogButton::No,"Occenabled Table"))
        return;
    fileName = WinAPI::getFolderPath(#CSIDL_Personal) + "\\" + "A02AvgPrice.csv";// + date2str(systemdateget(),321,2,0,2,0,2) + ".CSV";
    permission  = new FileIOPermission(fileName,#io_write);
    permission.assert();
    commaIo = new CommaIo(fileName,#io_write);
    if(!commaIo)
    {
        warning("Please close your csv file and try again. Thanks!");
        return;
    }
    if(commaIo.status() == IO_Status::Ok)
        CommaIo.outFieldDelimiter(",");
    else
        return;
    start = timeNow();
    records = m_dictionary.tableCnt();
    sysProgress = SysOperationProgress::newGeneral(#AviUpdate,"Waitting ... write CSV file",records);
    CommaIo.writeExp(["Id","Table Id","Table Name","Table Label","Occenabled","utilElementType"]);
    for (i = 1; i < records; i++)
    {
        m_dictTable = new sysdictTable(m_dictionary.tableCnt2Id(i));
         sysProgress.incCount(1);
        sysProgress.setText(strfmt("completed %1 [%2]: %3",i/ records * 100, i, m_dictTable.name()));
        if(!m_dictTable.occEnabled())
        {
            m++;
            CommaIo.writeExp([m,m_dictTable.id(),m_dictTable.name(),m_dictTable.label(),m_dictTable.occEnabled(),m_dictTable.utilElementType()]);
        }
        sysProgress.update(true);
    }
    if(m)
    {
        if (winAPI::fileExists(fileName))
        {
            winAPI::shellExecute(fileName);
        }
    }
    CodeAccessPermission::revertAssert();
    info(strfmt("It takes time %1",global::time2StrHMS(timenow() - start)));
    info(strfmt("completed %1 records",m));
}
 ------------------
 static void THK_tableOccenabledFromAOT02(Args _args)
{
    #AOT
    #properties
    TreeNode        TreeNode = TreeNode::findNode(#TablesPath);
    str             tableName;
    AnyType         occenabledProperty;
    sysdictTable    m_dictTable;
    int             i,records,m;
    Dictionary      dictionary = new dictionary();
    #File
    #WinAPI
    #Avifiles
    CommaIo                 commaIO;
    SysOperationProgress    sysProgress;
    fileName                fileName;
    FileIOPermission        permission;
    int                     start;
    ;
    if(!Box::yesNo("Are your sure lookup Occenabled table infomation?",dialogButton::No,"Occenabled Table"))
        return;
    fileName = WinAPI::getFolderPath(#CSIDL_Personal) + "\\" + "A02AvgPrice.csv";// + date2str(systemdateget(),321,2,0,2,0,2) + ".CSV";
    permission  = new FileIOPermission(fileName,#io_write);
    permission.assert();
    commaIo = new CommaIo(fileName,#io_write);
    if(!commaIo)
    {
        warning("Please close your csv file and try again. Thanks!");
        return;
    }
    if(commaIo.status() == IO_Status::Ok)
        CommaIo.outFieldDelimiter(",");
    else
        return;
    start = timeNow();
    records = dictionary.tableCnt();
    sysProgress = SysOperationProgress::newGeneral(#AviUpdate,"Waitting ... write CSV file",records);
    CommaIo.writeExp(["Id","Table Id","Table Name","Table Label","Occenabled"]);
    TreeNode = TreeNode.AOTfirstChild();
    while (TreeNode)
    {
        i++;
        tableName = findProperty(TreeNode.AOTgetProperties(), #PropertyName); //table - > Name
        sysProgress.incCount(1);
        sysProgress.setText(strfmt("completed %1 [%2 / %3]: %4",i/ records * 100, i,records, tableName));
         occenabledProperty = findProperty(TreeNode.AOTgetProperties(),"Occenabled");
        if(occenabledProperty == "No")
        {
            m++;
            CommaIo.writeExp([m,"",tableName,"",occenabledProperty]);
        }
        TreeNode = TreeNode.AOTnextSibling();
        sysProgress.update(true);
    }
    if(m)
    {
        if (winAPI::fileExists(fileName))
        {
            winAPI::shellExecute(fileName);
        }
    }
    CodeAccessPermission::revertAssert();
    info(strfmt("It takes time %1",global::time2StrHMS(timenow() - start)));
    info(strfmt("completed %1 records",m));
}


Источник: http://axforum.info/forums/blog.php?b=399
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
За это сообщение автора поблагодарили: alex55 (1).
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Microsoft Dynamics CRM Team Blog: Creating and Publishing a Web Portal to an Azure Cloud Service Blog bot Dynamics CRM: Blogs 0 17.04.2013 23:11
Microsoft Dynamics CRM Team Blog: Customizations in the December 2012 Service Update Blog bot Dynamics CRM: Blogs 0 12.03.2013 03:28
emeadaxsupport: AX for Retail 2012 R2: Adding a Custom User Control to the POS Blog bot DAX Blogs 0 27.02.2013 07:14
DynamicsAxSCM: Visualizing Security in Microsoft Dynamics AX 2012 Blog bot DAX Blogs 0 29.08.2011 13:11
DynamicsAxSCM: Personalization of Role Centers in Dynamics AX 2009 Blog bot DAX Blogs 0 21.06.2010 16:05

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

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

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