November 16, 2015

Use one table for creating multiple relation

Hi Folks,
After a long time I’m writing this new post.
Requirement: I need to use the single table to add multiple relation on a table. For eg. I have a parent table Table1 with field ItemId and ProcessItem. Now I need to add relation to InventTable to both fields. Hence I have to create two relation with InventTable.

How to do: Add two new relation in your table as shown below.

You might get an error message after this,
'RelatedTableRole' conflicts with another 'RelatedTableRole' on relation InventTable_Item on table ProcessedItemTable.
Solution to this error:
Set below two properties to each relation
1. UseDefaultRoleNames- set it to “NO”
2. Role: Give any logical name here, for eg. “Item”

Now compile your table, error must gone.
Write your any query/feedback in comment box and help us to improve. Thanks..!!!

October 11, 2015

Third time in a row.......

Hi All, 

I would like to share this golden moment with you all, Again I’m awarded by Microsoft as Most Valuable Professional (MVP) this year as well.
It's the third time in a row when I recognized by Microsoft for Dynamics AX. 

Thanks to each of you for your guidance and support.   

Old Post:

-Deepak Agarwal aka Harry 

Follow us on Facebook to keep in rhythm with us. @Facebook

September 15, 2015

DIXF error [AX2012 CU8]

Issue: While Open Processing Group (Data import export framework/Area page/Common/Processing Group), system throws below error message.

Could not load file or assembly 'Microsoft.Dynamics.AX.Framework.Tools.DMF.PreviewGrid, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.


Possible reason:

After a fresh installation of AX, we have DIXF as a module but we need to install additional component as well to use DIXF.
In this case we need to install DIXF client services from installation media.


Install DIXF client services from AX setup and restart the AOS services.

Keep sharing your feedback as comment…..

Related post:
DIXF Error- Assembly containing type

September 13, 2015

How to Export/Import Label files in AX 2012

Label are pretty different in AX2012 instead of earlier version of AX. Here is quick steps to import and export Label files from one Environment to other. You also perform an update on label files.
Export a Label file:
Open AOT, Expend Label node. Choose Label and require language to export. You can do it for individual language or you can select multiple language all in once.
Exported file will save on selected path with extension “.ald”.
Import Label File:
Right click on Label node in AOT and select “Create from File”, choose ald file to import than hit create.


Update a Label file:
Import the new updated label file system will ask to overwrite , go ahead
It will update your existing Label file.
Note: You must run full Synch after every import/Update.
More info:

August 26, 2015

Date manipulation through X++ code [AX 2012]

Hi Folks,

I come though a requirement where I need to manipulate on “FromDate” and “ToDate”. When user enter these value through a dialog box, user can select any day from month for eg.

From Date: June 6, 2015
To Date: August 20, 2015


And to perform some action on Financial stuff we may need to consider the whole month like
from June 1, 2015 to August 31, 2015

You can fetch this month range in your x++ code, here is a sample code, try it…
static void theAxapta_MonthRange(Args _args)
    DialogField                     dialogStartDate, dialogEndDate;
    Dialog                          dialog = new Dialog("Month range");
    TransDate                       fromDate, todate;

    dialogStartDate = dialog.addField(extendedTypeStr(TransDate));
    dialogEndDate   = dialog.addField(extendedTypeStr(TransDate));
    dialogStartDate.label("From Date");
    dialogEndDate.label("To Date");
        fromDate = mkDate(1, mthOfYr(dialogStartDate.value()), year(dialogStartDate.value()));
        toDate   = (mkDate(1, (mthOfYr(dialogEndDate.value()) + 1), year(dialogEndDate.value())) - 1);
        info(strFmt("Start Month %1", fromDate));
        info(strFmt("End Month %1", todate));



In case of any suggestion and query, feel free to drop as a comment.


July 04, 2015

AX7 aka Rainier , The most awaited version of Dynamics AX

Hi Folks,
Very soon we all are going to meet with AX7, by the end of this year it must be out in market. Initially this is going to be cloud only, with Azure you need LCS account to deploy this on cloud. In this version MS going to introduce many major/minor changes in their product like
- Initially there is on premises deployment, only cloud is the only option.  
- Development will happen in Visual studio only. (I guess we need the ultimate version only)
- New AOT design
- Totally web based UI, no rich client.
- No more life for Enterprise portal.
I will keep you posted about the updates on AX7.

-Harry Follow us on Facebook to keep in rhythm with us. @Facebook

June 22, 2015

Restore the DB, showing DB in use

Hi Folks,

Recently I was facing some issue while restoring AX database, whenever I try to restore the Transactional DB its show error "DB is use" while actually this DB is not used anywhere. Than I try to take take the database offline, But again there was one other issue.
Same issue again DB offline taking very long time.
I tried below steps and this worked for me. :)
Step 1: Try to run below two queries in same given sequence.
Step 2: Now try to take offline manually.
Step 3: Restore the DB.
Step 4: Some time after doing restoration/backup DB will not work.
Than u need to roll back above query operation
Related Post:
AX DB restoration: Database goes into “Restoring” state for long

June 14, 2015

Dynamics AX 2012 R3, CU9 is out in market.

Hi Folks,

Finally CU9 is released this week.
Here is some more details about this Cumulative update.

New Highlights

1. Introduced new features into HR, Transportation Management,Warehouse Management and Retails modules.
2. Many county-specific regions updates including US, UK, INDIA, Poland, Belgium, Brazil, Europe, Germany, India, Italy, Lithuania, Mexico, Netherlands, Russia, Spain, Austria and Poland

General Information
1. Installation Guide
2. What’s new in CU9
3. Build No: 6.3.2000.326
    Kernel: 6.3.2000.326

Download Option:
1. From LCS
2. From Partner/Customer resource

- Harry

June 08, 2015

AX DB restoration: Databsae goes into “Restoring” state for long

While restoring the AX DB , after completion of this process respective DB stuck into “Restoring” state

You need to run below query to fix this.


June 01, 2015

Error with Windows live writer and blogger

Hi Guys,

I was facing some error using Windows live writer, every time I tried to access my blog account on live writer is showing below error message

Blogger Returned the following error:
NotFount: Not Found

It seems some technical issue is there at Micsoft/Google side, we need to wait for a solution.

Below is some useful links on this ongoing issue, (Still waiting for any solution from either Microsoft or Google itself)!topic/blogger/-49FC2_0l-g

 Follow us on Facebook to keep in rhythm with us. @Facebook

Error while Confirming PO, and in Sales Order

Hi Folks,

After applying one HotFix, I got many weird issues, some are mentioned below

1. I wasn't able to confirm any Purchase Order
2.Not able to proceed Sales order to Warehouse.
3.While packing slip of Sales Order, I am getting many lines of different sales order.

Below error message bother me every time.

All you need to do, unmark the below check box from

Now all above error message must not come again.
To do this for all user in one shot, use below job to do it. 

static void theAxaptaUpdate(Args _args)
    UserInfo        UserInfo;
    update_recordSet UserInfo
    debugInfo = 1036
    where UserInfo.debugInfo == 12;


Follow us on facebook to keep in  rhythm with us. @Facebook

May 28, 2015

Copy AX DB from one domain to other domain

Hi Folks,

Many time we need to restore one Database to another system which is not part of current domain. In such cases its not going to be straight forward to click on restore button on SQL. You need to perform some other action to make it work. 
  Use below steps to restore AX DB from a different Domain.

1. Restore DB using SQL management studio.
2. Edit UserInfo table in SSMS (SQL server management Studio).
you need to update the SID and domain. To find current system user SID use below steps.
SID of current system user:
Run below command in Command prompt.
whoami /user

You can also copy if from Registry
Type RegEdit in run command

3. Open SSMS, open AX database-> Tables -> SysUserInfo

Update below field in 
i. UserId
ii. Domain
iii. SID

4. Now start AOS services and open ax client. It should work.


May 19, 2015

Error: Fields are not visible in Form while added in table and field group

Issue: I added below fields in a new table (I picked from DirPartyTable, yes we prefer to copy new fields from other table ;) )
1. FirstName
2. Middle Name
3. Last Name
While i add the same in a Form these fields are not visible at all.

Possible reason:
In DirPartyTable  the configuration key for all above fields is set to “SysDeletedObjects60”, also these fields are prefixed “DEL”  that means these fields may deprecated in next version on AX.

Here is very simple solution, Just remove the configuration key from YOUR NEW table fields(don’t play with DirPartyTable, do it in your new table).
than synch table and restore your form. Now check all fields should visible on form.
Also you can have a look on table “DirPersonName”. Here you will found the same fields.

- Harry

May 11, 2015

Error while table synch

Error: While doing Synchronization system throw below error

SQL error description: [Microsoft][SQL Server Native Client 11.0][SQL Server]Error: The new name '' is already in use as a COLUMN name and would cause a duplicate that is not permitted.

Solution: I am not very much sure it is the right way or not, but by doing this this error will remove.

Export this table and delete from your customized layer. Now Synch this table and restore.

Now import you code again, this error must remove.

If you have any better solution for this issue, plz let me know or put you comments on our FB page


May 05, 2015

Error while Unit Testing [AX 2012 R3]

Hi All,
I was facing below error while running test cases for a customization. 

  • An internal error occurred in the remove operation in the SysTestRecordCleanUp#Context object cache.
  • A critical error has occurred in function SysTestRecordCleanUp::cleanUpContext.
  • An error has occurred. Contact your administrator for further assistance.

  • clip_image001 
    Solution: However i am not very much sure why this error was coming and what is the main reason for this, but I used below steps and its resolved this issue.
    1. Stop to AOS
    2. Delete AUC files from below path.
    3. Restart AOS.
    Try now, it should work fine.

    April 26, 2015

    How to delete AUC files

    During many development we face some cache related issues. There is no error in code and still changes are not reflecting. Even after performing CIL, Compile and Sych but issue still existing. All these are happened due to ax_{GUID}.auc files. We need to clear(delete) these files from Appdata folder.
    To delete AUC(Application Unicode Cache) files we need to perform below steps.
    1. Stop AOS
    2. Delete AUC files from below path
    3. Restart AOS.
    PS: AOS restart is not mandatory. Its better to do it in this way however it will work without AOS restart.
    More details on AUC

    April 20, 2015

    How to send Email through X++ code

    Hi All,

    Use below code to sent emails from X++ code. Below code is written in a Job you can reuse the same in your logic. 

    static void dpk_TestEmail(Args _args)
        // Set these variables.
        str                                   sender = “”;
        str                                   recipient = '';
        str                                   cc = '';
        str                                   subject = 'TheAxapta_Subject';
        str                                   body = 'TheAxapta_Msg';
        str                                   fileName = @'D:\test.txt';
        List                                  toList;
        List                                  ccList;
        ListEnumerator                        le;
        Set                                   permissionSet;
        System.Exception                      e;
        str                                   mailServer;
        int                                   mailServerPort;
        System.Net.Mail.SmtpClient            mailClient;
        System.Net.Mail.MailMessage           mailMessage;
        System.Net.Mail.MailAddress           mailFrom;
        System.Net.Mail.MailAddress           mailTo;
        System.Net.Mail.MailAddressCollection mailToCollection;
        System.Net.Mail.MailAddressCollection mailCCCollection;
        System.Net.Mail.AttachmentCollection  mailAttachementCollection;
        System.Net.Mail.Attachment            mailAttachment;
            toList = strSplit(recipient, ';');
            ccList = strSplit(cc, ';');
            permissionSet = new Set(Types::Class);
            permissionSet.add(new InteropPermission(InteropKind::ClrInterop));
            permissionSet.add(new FileIOPermission(filename, 'rw'));
            mailServer = SysEmaiLParameters::find(false).SMTPRelayServerName;
            mailServerPort = SysEmaiLParameters::find(false).SMTPPortNumber;
            mailClient = new System.Net.Mail.SmtpClient(mailServer, mailServerPort);
            le = toList.getEnumerator();
            mailFrom = new System.Net.Mail.MailAddress(sender);
            mailTo  = new System.Net.Mail.MailAddress(strLTrim(strRTrim(le.current())));
            mailMessage = new System.Net.Mail.MailMessage(mailFrom, mailTo);
            mailToCollection = mailMessage.get_To();
            while (le.moveNext())
            le = ccList.getEnumerator();
            mailCCCollection = mailMessage.get_CC();
            while (le.moveNext())
            mailAttachementCollection = mailMessage.get_Attachments();
            mailAttachment = new System.Net.Mail.Attachment(fileName);
            info("Email sent.");
        catch (Exception::CLRError)
            e = ClrInterop::getLastException();
            while (e)
                e = e.get_InnerException();


    April 13, 2015

    System trade line number increment is not specified.

    Hi Friends,

    I faced one Error while creating Purchase Order from Approved Purchase Requisition
    Error Message:
    System trade line number increment is not specified.
    Purchase order creation has been cancelled due to errors


    Reason: As mentioned in error message there is one parameter missing.'

    Possible Solution:Click on “System Parameter” from infolog window or go to
    System administration -> Setup -> System Parameter
    Under System Line Number, Change the increment from 0 to 1.


    Now try again to create PO.


    Double click on purchase order number to open PO from.

    - Harry

    April 08, 2015

    How to deploy Dynamics AX instance on Azure through LifeCycle Service (LCS)- Part II

    Hi All,

    In my previous post we discussed how to configure your Azure account with LCS services and how upload LifecycleServicesDeployment certification on Azure portal.
    In this post i will show you how to deploy the AX using LCS on Azure.
    Step: 1 Login into your LCS account, select the project you want to deploy. Go to environment and click on ‘+’ symbol


    In next screen you need to choose topology to deply.
    DEMO: for demo purpose
    DEVTEST: For development or testing
    Here we will use DEMO topology, click on DEMO
    image ‘'

    On next screen you need to choose Product version. Click on “Demo AX 2012 R3 CU8”

    On the next screen give a name for this instance. (You can select a different size). Click on next.

    It will ask for a confirmation for deployment. Click on deploy.
    Now LCS will deploy the environment on Azure, this may take some time to complete this step.

    Now on right side tile click on VM Name “DEMO####”

    It will download a RDC file. Save this file and open with user name and Password.

    Your Cloud VM is ready for use.
    - Harry

    April 01, 2015

    New book released Microsoft Dynamics AX 2012 R3 Reporting Cookbook

    Hi Folks,
    I am very happy to share with all of you that my new book just released in market.
    Microsoft Dynamics AX 2012 R3 Reporting Cookbook

    This book is recommended for Dynamics AX developers and .NET-based SSRS developers looking to familiarize themselves with the new AX reporting framework.
    This book contain 10 chapters 


    For details check on web stores to get your copy.
    - Harry

    March 27, 2015

    Auto Settlement of Sales Invoice in AX

    In an organization where thousands (or more) of sales transaction happening every day, and here is this auto settlement requirement comes in picture. Auto settlement process save a ton of time to manually settlement of each and every customer or record. There are three different ways to perform a auto settlement of the sales invoices.

    1. By Sales parameter select auto settlement.
    2. By select open transaction at the time of invoice posting
    3. Through X++ code

    1. By Sales parameter select auto settlement: Go to AR/Setup/Parameter under settlement tab you will found a check box for automatic settlement. Select this check box. And your system will auto settle your sales invoice.

    This will settle a transaction whenever you post a payment journal.

    2. By select open transaction at the time of invoice posting: You can also choose the open transaction at the time of invoice journal creation. At the time of invoicing click on “open transaction settle” button, this will open a new form to select records to be settle from open transaction of that customer.



    3. Finally we have code as well (I love this part ;)): So here we are to do some tricky things. Yes, we can do the settlement by X++ code as well. Below code is an example in Job. You can use the same logic for any trigger point in AX.

    static void theAxapta_AutosettlePayment(Args _args)
    CustTable custTable;
    CustTrans invCustTrans, payCustTrans;
    SpecTransManager manager;
    CustVendTransData custVendTransData;
    custTable = CustTable::find("504411");
    // Find the oldest unsettled invoice
    select firstonly invCustTrans
    order by TransDate asc
    where invCustTrans.AccountNum == custTable.AccountNum &&
    invCustTrans.TransType == LedgerTransType::Sales &&
    // Find the oldest unsettled payment
    select firstonly payCustTrans
    order by TransDate asc
    where payCustTrans.AccountNum == custTable.AccountNum &&
    payCustTrans.TransType == LedgerTransType::Payment &&
    // Create an object of the CustVendTransData class with the invoice transaction as parameter
    custVendTransData = CustVendTransData::construct(invCustTrans);
    // Mark it for settlement
    // Create an object of the CustVendTransData class with the payment transaction as parameter
    custVendTransData = CustVendTransData::construct(payCustTrans);
    //mark it for settlement
    // Settle all marked transactions
    if(CustTrans::settleTransact(custTable, null, true,
    SettleDatePrinc::DaysDate, systemdateget()))
    info("Transactions settled");


    - Harry

    March 23, 2015

    How to deploy Dynamics AX instance on Azure through LifeCycle Service (LCS)- Part I

    Hi All,
    In this post I will demonstrate how to configure your Azure account  with LCS(LifeCycle services) project to deploy the AX on Azure cloud.
    In second part of this post I will share how to actual deploy the AX on Azure.
    Here is quick steps to setup/configuration your Azure with LifeCycle services
    Step 1: Login you LCS services
    Step 2: Create a new project or you can use any existing project as well. Here in this tutorial I will take an example with new instance creation.
    Click on + button and fill the details and click on create.
    After create a new project below screen will come which shows, your project created successfully.
    Step 2: Now click on Microsoft Azure setting under environments
    To proceed further you need you Azure subscription id. To find your subscription id Login into your Azure management portal.  Scroll down click on setting and copy from here
    Paste this Subscription id in below field
    Step: 3 Download management certification (file name : LifecycleServicesDeployment.cer)
    This certificate will enable Lifecycle Services to communicate with Azure on your behalf. Download this management certificate to your local computer. Then, upload the management certificate to the Azure management portal (Settings > Management Certificates).
    To  upload this certification Login into your Azure management portal.  Scroll down click on setting click on Management Certificate than click on “Upload Management certification”
    Upload the “LifecycleServicesDeployment.cer” file here.
    Step :4 Now on LCS window click on next and select Azure region and click on “Connect”.
    clip_image008 '
    So here we completed the setup of LCS with Azure.
    In my next post i will share how to deploy the AX on windows Azure environment. How to host AX on cloud.
    - Harry

    March 19, 2015

    Completed 200 posts today.

    Hi Friends,

    Today I completed my 200 posts. This cant be possible without your support and feedback. 
    A big thanks to all of you.


    Workflow setup in AX2012 R3 CU8

    Hi Folks,

    Here is the steps to setup the workflow in CU8. To setup workflow for first time, we need to setup it first.

    1. First of all we need a batch group which can handle the workflow triggers and proceed workflow task, also send the the notification to users.
     Go to System admin-> Setup -> Batch Group
    Add a new batch group for workflow,


    Add batch server accordingly.

    2. Now we need to setup the workflow parameters 
    Go to System Admin -> Setup -> workflow -> Workflow parameter

    Select workflow email template. (You may need to create a new workflow Email template)

    3. Go to System Admin -> Setup -> workflow -> click on Workflow infrastructure Configuration
    Now a wizard will open and Follow below steps

    4. Configure the workflow message processing batch job
    Select Batch group in below screen. (This may be not editable if already some records exists in respective tables)

    5. Configure the workflow due date processing batch job
    On next screen select same batch group and enter the number of hours for recurrence interval

    6. Configure the line-item workflow notification batch job
    In this screen we need to select a batch group and the number of minutes for recurrence interval of this job

    7. As next screen you will have below screen to finish this process

    So…. Now your system is ready for workflow process.