Sunday, October 28, 2012

Get Active workflow configuration

Hi Folks,

The below code snippet would help you to get an active workflow configuration in Ax 2009 for a workflow template.

WorkflowConfigurationTable  workflowConfigurationTable;
    select firstonly workflowConfigurationTable
                                                where   workflowConfigurationTable.TemplateName   ==         &&                                                  workflowConfigurationTable.Enabled              == NoYes::Yes     &&                                                    workflowConfigurationTable.Type                 == WorkflowConfigurationType::Definition  &&
                                                        workflowConfigurationTable.DefaultConfiguration == NoYes::Yes;

Happy DAXing............

Get fields set in the workflow configuration conditions

Hi Folks,

I have been busy with my project for sometime and so couldn't post anything on my blog. I have got an interesting post for today.

 i.e., The below code snippet will help you to get the fields or parm methods which is set in the query condition of Workflow configuration in AX 2009. I hope this would work good in AX 2012 as well.

    WorkFlowElementTable    elementTable;
    WorkflowStepTable       workflowStepTable;
    ExpressionTable         expressionTable;
    XmlTextReader           xmlTextReader ;
    str                     attributeName, attributeValue;
    Map                     parmMethodMap;
    Map                     fieldsMap;
    int                     delimiterPosition;
    TableName               tableName;
    FieldName               fieldName;
    parmMethodMap = new Map(Types::String, Types::String); // Stores the names of parm methods used in the conditions of a workflow configuratoion
    fieldsMap     = new Map(Types::String, Types::String); // Stores the names of parm methods used in the conditions of a workflow configuratoion    while select ExpressionId, ExpressionDefinition from expressionTable join ElementId, ExecuteStepId from workflowStepTable
                                                                         join ConfigurationId from elementTable
                                                                        where elementTable.ConfigurationId == _configId// Pass an active configuration id
                                                                           && workflowStepTable.ElementId  == elementTable.ElementId
                                                                           && expressionTable.ExpressionId == workFlowStepTable.ExecuteStepId
        xmlTextReader = XmlTextReader::newXml(expressionTable.ExpressionDefinition, true) ;

            if (xmlTextReader.NodeType() == XmlNodeType::Element)
                while (xmlTextReader.MoveToNextAttribute()) // Read the attributes.                {
                    attributeName   = xmlTextReader.Name();
                    attributeValue  = xmlTextReader.Value();
                    if (attributeName == #Property)
                        delimiterPosition = strfind(attributeValue, #Delimiter, 1, strlen(attributeValue));
                        tableName = substr(attributeValue, 1, delimiterPosition-1);
                        fieldName = substr(attributeValue, delimiterPosition+1, strlen(attributeValue)-strlen(tableName)-1);
                        delimiterPosition = strfind(fieldName, #Delimiter, 1, strlen(fieldName));
                        if (delimiterPosition)
                            tableName = substr(fieldName, 1, delimiterPosition-1);
                            fieldName = substr(fieldName, delimiterPosition+1, strlen(fieldName)-strlen(tableName)-1);
                        if (substr(fieldname, 1, strlen(#ParmPrefix)) == #ParmPrefix)
                            parmMethodMap.insert(fieldName, tableName);
                            fieldsMap.insert(fieldName, tableName);

You can modify the above code as well to get the expressions and values used in the workflow configuration conditions as well.

Happy DAXing............... :)

Thursday, June 28, 2012

Compilation error in SysReportLibraryExport class

Hi Folks,

Once I have compiled the complete AX 2009 environment on the Server where AOS is installed and found that there was a compilation issue in the Class declaration of SysReportLibraryExport class but it seems to be fine with other environments.

I couldn't get any clue why this happened suddenly and atlast I tried opening AX client of this environment from the database server and compiled this class. The syntax error is gone and there are no more issues in it even though i have opend it on the application server environment.

I hope this post would help facing similar issue.

Tuesday, June 5, 2012

insert_recordset doesn't take the value of TableId from the value

Hi Folks,

Today, I have observed a very strange thing in AX.

I had to do a bulk insert from some other table where I also need to copy the tableId from the other table.

I have found a strange issue i.e.,everything was getting copied except the tableId. You can try this in a job.

insert_recordset TestTable1(RefRecId, RefTableId) select recId, TableId from TestTable2;

So, the tableid from some other table cannot be used in Insert_recordSet. Atlast, I had to use RecordInsertList class to insert the bulk data.

Sunday, May 13, 2012

Cryptography in AX using CryptoAPI class

    Hi Folks,

For some clients, you would require to encrypt some phrases or words like passwords. For this, we can use cryptography class(CryptoAPI) which would allow us to encrypt/decrypt the phrases. The following example explains about the CryptoAPI class.

    CryptoApi cryptoApi;
    Container cont,cont1;
    ContainerClass cc;
   /* Salt is like a password, While encrypting and descrypting the phrase, the CryptoAPI class has to instantiated with same salt(99999999999). The phrases/words are encrypted & decrypted based on the salt. */
    cryptoApi = new CryptoApi(99999999999);
    cc = new ContainerClass(["giridhar"]);
    cont = CryptoApi.encrypt(cc.toBlob()); // The encrypt method requires BLOB as a parameter
    cont1 = ContainerClass::blob2Container(CryptoApi.decrypt(cont));

Happy DAXing............

Saturday, May 12, 2012

Friday, March 30, 2012

AX 2012 and Microsoft Lync / Microsoft office Communicator

Hi folks...........

AX 2012 is simply powerful.........Microsoft Lync & Microsoft office Communicator have been integrated with AX 2012 and its pretty simple to do it............

But the Pre-requisites are AX 2012 client should be installed on your machine and you have to be logged into Microsoft Lync / Microsoft office Communicator.

  1.  Open Customer Details form ( Accounts Receivable - > Common - >Customer -> All Customers)
  2. Click on New Customer button on the top of the form.
  3. Set the record type to 'Person' and fill other mandatory fields and click on Save and Close button.

4.  Double Click the newly created customer recordon the Customer master form.
5.  Go to Contact Information - > More Options -> Advanced

6. Click on 'Add' to create new contact information of customer and fill the e-mail address(Should be accessible through OC/Lync) and mark the option 'Instant messenger sign-in'.

7. Now we can notice that the Status symbol is displayed against the customer Id and some other OC/Lync options like Add to Communicator contacts(This option appears if it hasn't been added before), Send an Instant Message, Send an E-mail Message, Call, Share etc.,

I hope this will be a useful tool and could help in promoting AX & impressing our clients. \

Try all the above steps and Happy Daxing.......

Dynamics Top 100 Influential People

The voting for Dynamics Top 100 influential people for the year 2012 has started and luckily I am one of the nominee(1 out of 400 people) in the list. This list is an indicator of people standing for Dynamics Community across all the Microsoft Dynamics products. It is for the first time that I have made to the nominee list and I feel very excited about it.

If you think I deserve it and helpful/influenced you through my blog ( , A blog dedicated to Dynamics AX community which has 40,000+ page views and 17 followers), my linkedIn group (Microsoft Dynamics AX 2012 which has 2800+ members), my work in the Dynamics community and my passion for AX then show me your support  by voting for me(Giridhar Raj Singh Chowhan) and putting me into this years list of Microsoft Dynamics top 100 influential people.

You can vote for me by clicking on the below link and mark a vote against my name(Giridhar Raj Singh Chowhan)

Thanks in advance!!!!

Have a happy weekend!!!!!

Thursday, March 15, 2012

Installation of AX 2012 with SSRS and EP from scratch

Hi Folks,

This post is about my experience and steps for installing AX 2012 along with EPand SSRS. I have been planning to install AX 2012 from scratch on my laptop along with SSRS and EP because I was not feeling comfortable with the VPC. In today's post, I would like to explain you about my installation experience. I hope this would help someone who is planning for a single computer installation.
  1. I wanted to start this installation from scratch. So, Initially I have installed Windows Server 2008 R2.
  2. Installed Active Directory using Role Manager and dcpromo. The following link would help you in installing Active directory.
  3. Created a BCProxy account with an unexpired password account.
  4. Installed SQL Server 2008 R2 with SSRS and SSAS which is pretty simple.
  5. Installed Web Server (IIS) in Windows Server 2008 for sharepoint(Server Manager->Roles->Add Roles-> Mark on Web Server and click Install).
  6. Later installed SharePoint 2010 and configured it. During the SharePoint Configuration I have faced few issues but the below link has helped me in configuring the SharePoint successfully.
  7. Installed Visual Studio 2010 Ultimate for editing or creating SSRSreports/EP pages.
  8. I have also installed Microsoft Office 2010 because it is a pre-requisite for AX 2012 single computer installation as there is some Add-On to integrate AX2012 and Office suite.
  9. Now, before starting AX 2012 installation. I have gone through a link ( which are some pre-requisites before we install Reporting extensions and based on it i made sure that SSRS URL is working perfectly.
  10. After everything, I ran AX 2012 setup which has shown some pre-requisites where we need to configure few things/install few hotfixes related to SQL server, Sharepoint, SSRS etc.,
  11. During the installation, It was asked for the BCProxy account and its password. I have specified it which has been created in Step 2.
  12. Updated AX 2012 with Cumulative update -2.
  13. Launched AX 2012 and finalized the installation checklist.
  14. Tested SSRS reports from AX and also Enterprise portal. Both were working fine and finally I have achieved my target.
 I hope to receive some comments from the people who have followed the above process and installed AX 2012 successfully with SSRS and EP on their personal laptops/PCs.

Happy DAxing!!!!!!!!!!!

    Wednesday, March 7, 2012

    Dream come true

    I have and always had a great passion for computing and Information technology since my childhood. Microsoft has always been my dream company because I always believed  that this is the only place across the globe which can fulfill all my/anyone’s dreams when it comes to software technology and in the same way, I am very fortunate enough to work on Microsoft technologies since the start of my career. At last, My dream has come true when I joined Microsoft on 9th Jan. The company's work culture and facilities are awesome. I am glad that atlast I have landed into my childhood dream company. Now, I am excited to be part of Microsoft as it gives an opportunity to work with the best brains in the industry in an employee friendly & open culture and to be armed with knowledge of several MS products/technologies.

    Microsft Rocksssssssssss.

    Tuesday, January 17, 2012

    Temporary Tables defaulted to DAT company in AX 2009

    Hi Folks,

    I think its been a long time that I have posted some post on my blog.

    2-3 weeks back, One of my customer has been facing a continous AOS crash issue then when I have googled it using the event log messages, I have come across a resolution for a support issue from Microsoft, saying that "In User Group permission, make sure all users belong to a user group where the user group's domain contains the DAT company. Also, ensure that the DAT company is not used to save any data."

    The reason for this is that due to design limitation tempoary tables are defaulted to the DAT company similar to entire table caches and so the all User groups domain should contain DAT company.

    So, remember to include DAT company in User groups domain as practise which would avoid AOS crashes.

    Probably this might help someone who is facing the same kind of issue.

    The Error messages in the event viewer are as follows:

    Application Object server (AOS) crashed with error:

    Log Name: Application

    Source: Dynamics Server 02

    Event ID: 110

    Task Category: None

    Level: Error


    Object Server 02: Unexpected situation

    More Information: Delayed change company RPC failed.

    And then:

    Log Name: Application

    Source: Application Error

    Event ID: 1000

    Task Category: (100)


    Faulting application name: Ax32Serv.exe, version: 5.0.1500.2189, time stamp: 0x4b73d211

    Faulting module name: KERNELBASE.dll, version: 6.1.7600.16385, time stamp: 0x4a5bdfe0

    Exception code: 0xc0000005

    Fault offset: 0x000000000000aa7d

    Faulting process id: 0x%9

    Faulting application start time: 0x%10

    Faulting application path: %11

    Faulting module path: %12

    Report Id: %13
    Reference :