Sunday, December 8, 2013

How to convert Product master to Product in Ax2012


In One of my implementation I was having a requirement in this I had to convert product master to product across the companies. You can find in below code how we can do this.


public void convertProductMasterToProduct(ItemId    _itemId,
                                          str       _supplyCompany = "",
                                          str       _demandCompany = "")
{
    EcoResProductMaster             master;
    EcoResDistinctProduct           distinctProduct;
    EcoResProductTranslation        productTranslation;
    InventTable                     inventtable;
    EcoResProductIdentifier         productIdentifier;
    str                             text;
    str                             shortText;
    ;

    ttsBegin;

    master = EcoResProductMaster::find(inventtable::find(_itemId).Product, true);

    if (master)
    {
        distinctProduct.clear();
        distinctProduct.initValue();
        distinctProduct.DisplayProductNumber = master.DisplayProductNumber;
        distinctProduct.SearchName = master.SearchName;
        distinctProduct.ProductType = EcoResProductType::Item;
        text = EcoResProductTranslation::findByProductLanguage(master.RecId, CompanyInfo::languageId()).Description;
        shortText = EcoResProductTranslation::findByProductLanguage(master.RecId, CompanyInfo::languageId()).Name;
        master.delete();
        distinctProduct.insert();

       productTranslation.clear();
       productTranslation.initValue();
       productTranslation.LanguageId = CompanyInfo::find().LanguageId;
       productTranslation.Name = shortText;
       productTranslation.Product = distinctProduct.RecId;
       productTranslation.Description = text;
       productTranslation.insert();

       productIdentifier.clear();
       productIdentifier.initValue();
       productIdentifier.ProductNumber = _itemId;
       productIdentifier.Product = distinctProduct.RecId;
       productIdentifier.insert();
        if (_supplyCompany)
        {
            changeCompany(_supplyCompany)
            {
                inventTable = InventTable::find(_itemId, true);
                if (inventtable)
                {
                    InventTable.Product = distinctProduct.RecId;
                    inventtable.StandardConfigId = "";
                    InventTable.update();
                }
            }
        }
        if (_demandCompany)
        {
            changeCompany(_demandCompany)
            {
                inventTable = InventTable::find(_itemId, true);
                if (inventtable)
                {
                    InventTable.Product = distinctProduct.RecId;
                    inventtable.StandardConfigId = "";
                    InventTable.update();

                }
            }
        }
    }
    ttsCommit;


}

Dynamics AX Solutions Excellence Certification Program

Did you know about Dynamics AX Solutions Excellence Certification Program?



Code comparison:-Ax2012

Troubleshoot

Issue

No colours when comparing code in AX.










Reason
the latest version of the browser, IE10, doesn't support the gradient filter (CSS in HTML) once used for displaying the left hand side colour boxes.

Work around
Just change the HTML code put in the ActiveX components. Comment the code as shown below.




Collection of Walkthroughs & Tutorials

Microsoft Dynamics AX 2012 Build numbers

Microsoft Dynamics AX 2012 Build numbers.




Code to call Ax project reverse engineering tool

Code to call Ax project reverse engineering tool
SysVisioAddIn               sysVisioAddIn   = SysVisioAddIn::construct();

sysVisioAddIn.parmModelType(SysVisioModelType::ERModel);
sysVisioAddIn.parmFile(fileName);
sysVisioAddIn.parmUserSelection(SysVisioUserSelection::SharedProject);
sysVisioAddIn.parmProjectNode(SysTreeNode::getSharedProject().AOTfindChild(projectNode.AOTname()));

sysVisioAddIn.run();

Modules names changes in MS Dynamics AX 2009 Vs. AX 2012

Modules names changes in MS Dynamics AX 2009 Vs. AX 2012





MODULES IN AX 2009



MODULES IN AX 2012

Inventory Management
·       Inventory Management
·       Product Information Management


Accounts Payable
·       Procurement and Sourcing
·       Accounts Payable


Accounts Receivable
·       Sales and Marketing
·       Accounts Receivable



General Ledger
·       General Ledger
·       Budgeting
·       Fixed Assets
·       Compliance and Internal controls

Cost Accounting
·       Cost Accounting

Bank
·       Cash and Bank Management


CRM
·       Moved to Sales and Marketing module

Master Planning
·       Master Planning



Production
·       Production control


Product Builder
·       Moved to Product Information Management






Shop floor Control
This Module is split into three and can be accessed from Home, Human resources and Production Control Modules.
·       Time and Attendance     – Human resources.
·       Clock In and Out – Home
·       Manufacturing execution – Production       control.

Human Resource
·       Human Resources

Questionnaire
·       Moved to Home

Expense Management
·       Travel and Expense


Projects
·       Project Management and Accounting (PSA)

Service
·       Service Management


Basic
·       Organizational Administration

Administration
·       System Administration