Monday, February 17, 2014

Create new project through X++

static void createProject(Args _args)
{
    sysprojectfilterrunbase upgradeproject;
    utilelements            theelements;
    ;

    upgradeproject = new sysprojectfilterrunbase();
    upgradeproject.parmProjectNode(systreenode::createProject('test'));
    upgradeproject.grouping(sysprojectgrouping::AOT);

    while select name, utilLevel, RecordType, ParentId from theelements
    where theelements.utilLevel == UtilEntryLevel::usr
    {
        try
        {
            theelements.reread();
            upgradeproject.doUtilElements(theelements);
        }
        catch (exception::Error)
        {
            throw error('error');
        }
    }

    upgradeproject.write();
    info('finish');
}

No comments:

Post a Comment