Friday, July 13, 2012

AX 2012 : Delete All Transactions

We need to modify the SysDatabaseTransDelete.handletable method with the below code :

void handleTable(SysDictTable sysDictTable)

{

    TableGroup      tableGroup;

    if (tableSet.in(sysDictTable.id()))

        return;

    tableSet.add(sysDictTable.id());

    if (sysDictTable && !sysDictTable.isTmp() && !sysDictTable.isMap())

    {

        tableGroup = sysDictTable.tableGroup();

        // Handle company specific tables to be deleted

        if (sysDictTable.dataPrCompany())

        {

            switch(tableGroup)

            {

                case TableGroup::Transaction:

                case TableGroup::WorksheetHeader:

                case TableGroup::WorksheetLine:

                //FIX - Support new AX2012 transaction table types

                case TableGroup::TransactionHeader:

                case TableGroup::TransactionLine:

                    this.handleTransTable(sysDictTable);

                    break;

                default:

                    this.handleNonTransTable(sysDictTable);

                    break;

            }

        }

        else

        {

            // Handle global tables to be deleted

            switch(tableGroup)

            {

                case TableGroup::Transaction:

                case TableGroup::WorksheetHeader:

                case TableGroup::WorksheetLine:

                //FIX - Support new AX2012 transaction table types

                case TableGroup::TransactionHeader:

                case TableGroup::TransactionLine:

                    this.handleGlobalTransTable(sysDictTable);

                    break;

                default:

                    break;

            }

        }

    }

}

No comments:

How to identify the user that was used to change an object from AOT in AX2012

Get the object name for which we need to track these (user and date&time) information's. Login to SQL Server Management Studio an...