>

Walkthrough: Creating a Workflow Template AX 2009

In Microsoft Dynamics AX, you define a workflow by creating a template to base the workflow on. In this walkthrough, you will create a workflow template in the Application Object Tree (AOT) that you can add approvals and tasks to.

A workflow template defines information about:

  • Which workflow document to use. The workflow document exposes calculated fields and identifies the query that exposes data fields for the workflow.
  • Tasks and approvals that can be configured by the end user.
  • Workflow categories used for assigning a workflow template to a specific module.
  • Menu items and event handlers.

This walkthrough illustrates the following tasks:

  • Create a workflow template in the AOT.
  • Create a query to expose data for conditions.
  • Create a workflow document class to identify the query and calculated fields.
  • Bind the query to the workflow document class.
  • Bind the workflow document class to the workflow template.
  • Create a workflow category.
  • Bind the workflow category to the workflow template.
  • Create a SubmitToWorkflow menu item.
  • Bind the workflow menu item to the workflow template.
  • Set a license configuration key for the workflow template.

Prerequisites

 

To complete this walkthrough, you will need:

  • Microsoft Dynamics AX
  • A license file that has access to the MorphX development environment
To create a workflow template in the AOT
  1. In the AOT, expand the Workflow node.
  2. Right-click the Workflow Templates node, and then select New Workflow Template. A workflow template group displays under the Workflow Template node.
  3. Right-click the new workflow template and then click Properties.
  4. In the Properties sheet, set the Name property to MyWorkflowTemplate.
  5. In the AOT, right-click MyWorkflowTemplate, and then click Save.

After the workflow template is created, you can create the objects that you need to bind to the workflow template. For this walkthrough, the next step is to create a query to identify the table data fields used for the workflow document.

To complete Article click here

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’);
}

How to Reverse a PO Invoice in Dynamics AX

You have to create a debit note from your purchase order that will be settled against your PO invoice to essentially cancel that balance on the vendor profile.

To process the debit note,

1- Add a new line on your PO with a negative quantity.

2- Confirm.

3- Post invoice.

You will need to go on the vendor profile to settle the original invoice with the new debit note so that balance will be gone from the vendor profile.

Follow

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

Join other followers:

error: Content is protected !!