Показать сообщение отдельно
Старый 15.12.2007, 01:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
axStart: Mass update on table properties
Источник: http://axstart.spaces.live.com/Blog/...C0A0!204.entry
==============


We all have run in trouble in the past when for a lot of tables the same update needs to be done:
Below script can help you out. It will look in all tables that are in the database (SQLDictionary)
Next it will find the related AOT Tree node.

X++:
static void ChangeTableProperties(Args _args)
{
    SQLDictionary   dictionary;
    TreeNode        treeNode;
    str             properties;
    ;
    while select dictionary
    where dictionary.fieldId == 0 &&  dictionary.name like("Proj*")
    {
        treeNode     = TreeNode::findNode('\\data dictionary\\tables\\'+dictionary.name);
        if (treeNode)
        {
            properties = treeNode.AOTgetProperties();
            properties = setProperty(properties, 'CreatedDate', 'Yes');
            properties = setProperty(properties, 'CreatedTime', 'Yes');
            properties = setProperty(properties, 'CreatedBy', 'Yes');
            treeNode.AOTsetProperties(properties);
            treeNode.AOTsave();
        }
    }
}



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