>

Category Archives: AX 2012

How to add new action under Context menu in Dynamics AX

Each node in the AOT contains a set of available actions. You can access these actions from the
context menu, which you can open by right-clicking any node.

You can create custom actions for any element in the AOT by enlist a class as a new add-in by following:
1. Create a new menu item and give it a meaningful name, a label, and Help text.
2. Set the menu item’s Object Type property to Class.
3. Set the menu item’s Object property to the name of the class to be invoked by the add-in.
4. Drag the menu item to the SysContextMenu menu.
5. If you want the action available only for certain nodes, you need to modify the verifyItem
method on the SysContextMenu class.

Common prefixes in Microsoft Dynamics AX

 

Prefix Description
As Microsoft Dynamics AX typed data source
Axd Microsoft Dynamics AX business document
Asset Asset Asset management
BOM Bill of material
COS Cost accounting
Cust Customer Customer
Dir Directory, global address
EcoRes Economic resources
Human resources Human resources
Invent Inventory management
JMG Shop floor control
KM knowledge management
Ledger General Ledger
PBA Product builder
Prod Production
Proj Project
Purch Purchase
Req Requirements
Sales Sales
SMA Service management
SMM Sales and marketing management also called customer relationship management (CRM)
Sys Application frameworks and development tools
Tax Tax engine
Vend Vendor
Web Web framework
WMS Warehouse management

How to: Track orders created by specific user in Dynamics AX 2012 R3

There are feature in AX to track order in AX 2012, the link video below explained how to implement That in AX.

The steps available in that video as the following:

1- Open Dynamics AX 2012 R3.

2- Go to Sales and Marketing –> Events —-> Order Events

3- Click new then select user Code ‘Table’.

4- Click user relation and select user you want to track his transaction.

5- set start date of track and end Date for period you want to track.

6- As per image below you can select which part you want to track.

image

7- Save and close.

8- Now login with the user you want to track his transactions.

9- Then go To Sales and Marketing –> Common —->  Sales Orders –> All Sales Orders

6- Create Sales Order.

image

6- Then Go Sales and Marketing –> Inquiries —->  Order Status —> Order Events

image

Video below explained How to Track orders created by specific user in Dynamics AX 2012 R3.

How To Track Orders in AX 2012 R3?

There are feature in AX to track order in AX 2012, the link below for video explained how to implement That in AX.

The steps available in that video as the following:

1- Open Dynamics AX 2012 R3.

2- Go to Sales and Marketing –> Events —-> Order Events

3- Click new then select user Code ‘All’.

4- As per image below you can select which part you want to track.

image

5- Then go To Sales and Marketing –> Common —->  Sales Orders –> All Sales Orders

6- Create Sales Order.

image

6- Then Go Sales and Marketing –> Inquiries —->  Order Status —> Order Events

image

Hint: To track Order For Specific Employee select user Code ‘Table’ then select the user from user relation.

Video below explained how Track orders in Dynamics Ax 2012 R3.

How to Delete Company Transactions in AX 2012 including Trial balance?

To delete Transactions data inside any company in ax, you can do by using the class SysDatabaseTransDelete under AOT.

But you may facing an issue since the Trial Balance will not be deleted so, to delete GL Trans by deleting the following tables:

GeneralJournalAccountEntry

GeneralJournalEntry

LedgerEntryJournal

LedgerEntry

Ledgerjournaltrans

Ledgerjournaltable

To remove the Trial Balance you have to follow the steps below:

1-) Modify ‘handleTable()’ method by adding 2 new cases

Case TableGroup::TransactionHeader:

Case TableGroup::TransactionLine:

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::TransactionHeader:

                case TableGroup::TransactionLine:

                case TableGroup::WorksheetHeader:

                case TableGroup::WorksheetLine:

                    this.handleTransTable(sysDictTable);

                    break;

                default:

                    this.handleNonTransTable(sysDictTable);

                    break;

            }

        }

        else

        {

            // Handle global tables to be deleted

            switch(tableGroup)

            {

                case TableGroup::Transaction:

                case TableGroup::TransactionHeader:

                case TableGroup::TransactionLine:

                case TableGroup::TransactionHeader :

                case TableGroup::WorksheetHeader:

                case TableGroup::WorksheetLine:

                    this.handleGlobalTransTable(sysDictTable);

                    break;

                default:

                    break;

            }

        }

    }

}

2) Add a new method to handle LEDGERJOURNALTABLE:

private void deleteLedgerJournalTables() 
{

    GeneralJournalEntry         GJEntry;
    GeneralJournalAccountEntry  GJAEntry;
    LedgerJournalTable          ledgerjournalTable;
    LedgerEntryJournal          ledgerEntryJournal;
    ttsBegin;
    while select forupdate LedgerJournalTable
    {
        while select forUpdate ledgerEntryJournal
            where ledgerEntryJournal.JournalNumber == ledgerjournalTable.JournalNum
            //&&    ledgerEntryJournal.dataAreaId == ledgerjournalTable.dataAreaId
        {
            while select forUpdate GJEntry
                where GJEntry.LedgerEntryJournal == ledgerEntryJournal.RecId
            {
                  delete_from GJAEntry  where GJAEntry.GeneralJournalEntry == GJEntry.RecId;
                GJEntry.delete();
            }
            ledgerEntryJournal.delete();
        }
        LedgerJournalTable.delete();
    }
    ttsCommit;
}

3) Modify the ‘handleTransTable()’ method to call the above method

void handleTransTable(SysDictTable sysDictTable)
{
    switch(sysDictTable.id())
    {
        case tablenum(CustCollectionLetterLine):
        case tablenum(InventDim):
        case tablenum(DocuRef):
        case tablenum(DirPartyRelationship) :
            break;
       case tablenum(LedgerJournalTable) :
            this.deleteLedgerJournalTables();
            break;
        default:
            this.deleteTable(sysDictTable);
            break;
    }
}

4) You may have to modify the ‘deleteVoucher()’ method in the ‘LedgerJournalTrans’ table to skip over releasing non-existing voucher numbers

public server void deleteVoucher(Voucher _voucher = this.Voucher)
{
    LedgerJournalTable  ledgerJournalTable = LedgerJournalTable::find(this.JournalNum);
    if (! ledgerJournalTable.Posted && !this.Transferred)
    {
        if (_voucher && ! LedgerJournalTrans::existTransMinusThis(this.JournalNum, _voucher, this.RecId))
        {
            if (this.checkVoucherNotUsed(ledgerJournalTable, _voucher))
            {
                if (this.checkVoucherNotUsedDataSource(_voucher))
                {
                    // replace the voucher number so it can be re-used
                    if (ledgerJournalTable.NumberSequenceTable) /* 28Nov12-Admin */
                        NumberSeq::releaseNumber(ledgerJournalTable.NumberSequenceTable, _voucher);
                    if (this.Voucher == _voucher)
                    {
                        // delete voucher template record if exists and the voucher on the line is not being changed
                        LedgerJournalTransVoucherTemplate::deleteForJournalOrVoucher(this.JournalNum, _voucher);
                    }
                }
            }
        }
    }
}

5) After running ‘SysDatabaseTransDelete’, rebuild balances for the financial dimension sets (General Ledger\Setup\Financial Dimensions\Financial dimension sets)

If you still have non-zero amounts in the Trial balance then you must manually remove the ‘left-over’ rows in the shared tables (results of your previous executions of the ‘SysDatabaseTransDelete’). Identify these entries in the ‘LedgerEntryJournal’ table then use the following job to clear them:

static void tg_deleteTables(Args _args)
{
    GeneralJournalEntry         GJEntry;
    GeneralJournalAccountEntry  GJAEntry;
    LedgerJournalTable          ledgerjournalTable;
    LedgerEntryJournal          ledgerEntryJournal;
    ttsBegin;
        while select forUpdate ledgerEntryJournal
            where ledgerEntryJournal.JournalNumber like ‘clau*’   
        {
            while select forUpdate GJEntry
                where GJEntry.LedgerEntryJournal == ledgerEntryJournal.RecId
            {
                  delete_from GJAEntry  where GJAEntry.GeneralJournalEntry == GJEntry.RecId;
                GJEntry.delete();
            }
            ledgerEntryJournal.delete();
        }
    ttsCommit;
    info(‘completed’);
}

Follow

Get every new post on this blog delivered to your Inbox.

Join other followers:

error: Content is protected !!