Sunday, September 9, 2012

Add ZipCode in Dynamics AX 2012

Claims-Based Flexible Authentication in Dynamics AX 2012

I had a scenario where we need to access the dynamics ax 2012 from external trusted user. Dynamics AX provide such a nice feature called Claims-Based Flexible Authentication in Dynamics AX 2012. Following article is very informative and helpful to implement this type of authentication.

http://community.dynamics.com/product/ax/axtechnical/b/axfortechies/archive/2012/05/01/claims-based-flexible-authentication-in-dynamics-ax-2012.aspx

Happy DAXing !!! 

Thursday, July 19, 2012

Display infolog in EP web part

To programmatically add messages to the Infolog, add the following namespace to your user control.

using Proxy = Microsoft.Dynamics.Framework.BusinessConnector.Proxy;

You can then add a message to the Infolog.

Proxy.Info objInfoLog = new Proxy.Info(this.AxSession.AxaptaAdapter);
objInfoLog.add(Proxy.Exception.Warning, "Hello World");

Wednesday, May 16, 2012

Dynamics AX EP timeout issue

Sometime for debugging or traversing large data in EP causing an issue of timeout, we can increase the timeout by setting the AsyncPostBackTimeout for AJAX which was causing the timeout. Here is the code which we can write in Page_Load event:

protected void Page_Load(object sender, EventArgs e)
{
    ScriptManager scripts = ScriptManager.GetCurrent(this.Page);

   if (scripts != null)
    {
        scripts.AsyncPostBackTimeout = 800; // 800 seconds
    }

}

Monday, May 14, 2012

Changing the language at runtime in X++

During searching the same task, I found follwoing link to change user language at runtime:
Changing the language at runtime in X++

Easy way to get SID

Most of the time when we switch back and forth from staging to production environment, we want to get the SID for the current user setting, here are the steps you  can perform to scussfully logon to Dynamics AX:
1. Open the command prompt and type "wmic path win32_useraccount where name="{Domain user name}" get sid"
2. Copy the SID.
3. Open the SQL server and write following command to update current admin user:

             use {AX DB}
             update USERINFO
             set SID = '{paste the SID here from step#2}', NETWORKDOMAIN='{Network domain}',         NETWORKALIAS='{User Id}' where ID='Admin'

Wednesday, March 21, 2012

Open Dynamics ax in specific language

To open MS Dynamics AX in specific language via a command, you can use it in following manner:

1. Open commoand prompt.
2. Type Ax32.exe –language=culture_id

Example : Ax32.exe –language=en-us

Friday, February 24, 2012

Financials basic training

Again, another useful information shared by Dynamics AX Training team related to financials basic training. here is the link:
http://www.dynamicsaxtraining.com/financial-training/basic-concepts

Thursday, February 2, 2012

Release products to the legal entities using X++

In this post, I would like to share X++ Code that will help to release products to the legal entities from product master.

static void releaseProducts_Job(Args _args)
{
    EcoResProduct ecoResProduct;
    InventTable inventTable;
    InventTableModule inventTableModule;
    NumberSequenceTable numberSequenceTable;
    ItemId itemId;
    InventItemSetupSupplyType inventItemSetupSupplyType;

    EcoResStorageDimensionGroupProduct ecoResStorageDimensionGroupProduct;
    EcoResTrackingDimensionGroupProduct ecoResTrackingDimensionGroupProduct;
    EcoResStorageDimensionGroupItem ecoResStorageDimensionGroupItem;
    EcoResTrackingDimensionGroupItem ecoResTrackingDimensionGroupItem;
    ;

    select firstOnly ecoResProduct where EcoResProduct.DisplayProductNumber == "test"; //Audio system

    changecompany ('CEU')
    {
        ttsBegin;
        inventTable = null;
        inventTableModule = null;
        inventItemSetupSupplyType = null;
        ecoResStorageDimensionGroupProduct = null;
        ecoResTrackingDimensionGroupProduct = null;
        ecoResStorageDimensionGroupItem = null;
        ecoResTrackingDimensionGroupItem = null;

        numberSequenceTable = InventParameters::numRefItemId().numberSequenceTable();
        //get item id from:
        //1. Product number if number seq for item ID is not set up or manual or return blank value
        if (!numberSequenceTable.RecId || numberSequenceTable.Manual)
        {
            itemId = ecoResProduct.productNumber();
        }
        else //number sequence auto, get a number
        {
            itemId = NumberSeq::newGetNumFromId(numberSequenceTable.RecId).num();
        }

        inventTable.initValue();
        inventTable.initFromEcoResProduct(ecoResProduct);
        inventTable.ItemId = ItemId;
        inventTable.NameAlias = ecoResProduct.SearchName;
        inventTable.insert(true);

        // Create inventTableModules

        inventTableModule.initValue();
        inventTableModule.ItemId = inventTable.ItemId;
        inventTableModule.ModuleType = ModuleInventPurchSales::Invent;
        inventTableModule.insert();

        inventTableModule.initValue();
        inventTableModule.ItemId = inventTable.ItemId;
        inventTableModule.ModuleType = ModuleInventPurchSales::Purch;
        inventTableModule.insert();

        inventTableModule.initValue();
        inventTableModule.ItemId = inventTable.ItemId;
        inventTableModule.ModuleType = ModuleInventPurchSales::Sales;
        inventTableModule.insert();

        //Create inventItemLocation
        InventItemLocation::createDefault(inventTable.ItemId);

        // Creates a new item default order type for the product that is released.

        inventItemSetupSupplyType.initValue();
        inventItemSetupSupplyType.ItemId = inventTable.ItemId;
        inventItemSetupSupplyType.ItemDataAreaId = inventTable.DataAreaId;
        inventItemSetupSupplyType.insert();

        //create relationship tables to dimension groups.

        ecoResStorageDimensionGroupProduct = EcoResStorageDimensionGroupProduct::findByProduct(ecoResProduct.RecId);
        ecoResTrackingDimensionGroupProduct = EcoResTrackingDimensionGroupProduct::findByProduct(ecoResProduct.RecId);

        if (ecoResStorageDimensionGroupProduct.RecId)
        {  
            // mandatory storage dimension group for the product
            ecoResStorageDimensionGroupItem.ItemDataAreaId = inventTable.DataAreaId;
            ecoResStorageDimensionGroupItem.ItemId = inventTable.ItemId;
            ecoResStorageDimensionGroupItem.StorageDimensionGroup = ecoResStorageDimensionGroupProduct.StorageDimensionGroup;
            ecoResStorageDimensionGroupItem.insert();
        }

        if (ecoResTrackingDimensionGroupProduct.RecId)
        {
            // mandatory tracking dimension group for the product
            ecoResTrackingDimensionGroupItem.ItemDataAreaId = inventTable.DataAreaId;
            ecoResTrackingDimensionGroupItem.ItemId = inventTable.ItemId;
            ecoResTrackingDimensionGroupItem.TrackingDimensionGroup = ecoResTrackingDimensionGroupProduct.TrackingDimensionGroup;
            ecoResTrackingDimensionGroupItem.insert();
        }
       
        ttsCommit;
       
        info("Product successfully released to CEU legal entity");
    }
}

Wednesday, February 1, 2012

Logon failed for the unattended execution account

Following are steps that need to be performed if you start getting login failed for unattended execution account error.

“An error occurred during client rendering.
 The report server has encountered a configuration error. Logon failed for the unattended execution account
 Logon failed (rsLogonFailed) Logon failure: unknown user name or bad password.”

If this happens then it means there are unattended execution account was configured and there is some problem with the account mentioned in the configurations. Either it has changed in Active Directory setup and the password has been expired or changed. This is optional setting but if you have configured it then it must be updated when there is change in the account information or password. Otherwise you may start getting the aforementioned error message.

 To configure the account:

 Launch the reporting services configuration manager and connect to the report server.

  1. Go to Execution Account and select the Specify an execution account checkbox.
  2. Enter the account information and click on Apply button. This must be the domain account.
Go to the report manager and access the reports and it should now run properly.

Friday, January 13, 2012

Create a public Enterprise Portal site

Happy New Year 2012 !!!!!

Due to my busy schedule here in USA, I was unable to share any new post with you guys.
But here is the very nice artical about How to create/expose enterprise portal site publically.
http://technet.microsoft.com/en-us/library/hh285823.aspx