Dynamics Axapta Coverage of Technical Tutorials Version 2009, 2012,Ax Rainier or version 7

Microsoft Dynamics Ax, Application Integration Framework, X++ programming, AX 2009 , 2012.Ax Rainier or version 7, Enterprise portal, SharePoint , BI Tools, OLAP, Performance Tuning, SSRS,SSIS,SSAS, Workflow.

Friday, October 9, 2015

Get Current date from User control on Enterprise portal web page in Visual studio for axapta

To Get Current date from User control for  Enterprise portal page in Visual studio for axapta you can set below code and show in message box.

string cDate1 = DateTime.Now.ToString("dd/MM/yyyy");
Proxy.Info objinfolog = new Proxy.Info(this.AxSession.AxaptaAdapter);

You can include above code in your click event or as per your required event. This code you need to write in visual studio . You need to add particular user control in visual studio project then open code file to write the code.

Wednesday, October 7, 2015

The type or namespace name 'Portal' does not exist in the namespace Ax 2009

Getting Error on build EP website in Visual Studio for Axapta 2009.

The type or namespace name 'Portal' does not exist in the namespace 'Microsoft.Dynamics' (are you missing an assembly reference?).


Solution for this error due to proxy classes required for this user control because its used in namespace.

You need to take below step for the same.

To fix  this error just go to your project and right click on the App_Code node in your solution explorer then select "Generate Proxies" option .  This process may take time for  building all of the classes from your proxy.  Now check again the build works for your project and its updated with your code.

Proxy objects located on below folder.


Friday, October 2, 2015

Sample code Example of Array in Axapta

This is  Sample code  Example of Array in Axapta .

    str             name;
    Array Arr = new Array (Types::String);
    int             i= 1, j;
    Int test;
   TestTable TestTable;

    // Create an Str array

    // Write some elements in it
    while select TestTable
        Arr.value(i, TestTable.TestTables);//(i, i*2);

    j = i;

    for (i = 1; i<j; i++)
        test= Arr.value(i);
        while select TestTable where TestTable.TestTables == test
            info(strfmt("%1", Arr.value(i)));

Job to import text file data to Table in axapta

I want to share code to  import text file data to Table in axapta. Here is sample of one field taken in text file.

    Dialog                  dialog = new Dialog('File Upload');
    Dialogfield             dialogfield;
    DialogField             dialogFileName;

    InventTable             inventTable;
    ItemID                  itemID;

    FileIOPermission        fileIOPermission;
    CommaTextIo             io;
    container               inLine;
    int                     lineNum;
    int                     i;

    dialogFileName  = dialog.addField(typeid(FilenameSave));

        fileIOPermission    = new FileIOPermission(dialogFileName.value(), #ioRead);
        io                  = new CommaTextIo(dialogFileName.value(), #ioRead);

        if (io)
            while (io.status()  == IO_Status::Ok)
                inLine  = io.read();

                if (io.status() != IO_Status::Ok)
                itemID = conpeek(inLine,1);
                    inventTable = inventTable::find(itemID,true);
                        inventTable.ItemGroupId = conpeek(InLine,2);
                        info(strfmt('Cant find Item %1',itemID));

Sunday, September 27, 2015

Resolved - Workflow error during Order approval in Axapta

Error Details:-Today I faced following error .
Workflow instance:xxxxxxx was terminated for the following reason: No .NET Business Connector session could be found..

Due to this workflow work item not created after submission to workflow.

Solution:To resolve this issue I did the following.

1.Compile application.
2.Resetting of IIS.
3. Reset Dotnet framework version on IIS if its changed by someone.
4. Recreate business connector configuration from Ax client configuration.

This issue happen in Ax 2009 version and issue is now resolved .

Thursday, September 3, 2015

Print Report in PDF in EP Site in axapta 2009,4.0

If you are trying to print and display report in Enterprise portal in axapta then you need to add some code in class EPSenddocument on new method.

 case tablenum(CustPackingSlipJour): 
                           = SalesTable::find(record.(fieldnum(CustPackingSlipJour,SalesId))).Email;

                           if (record.(fieldnum(CustPackingSlipJour,InvoiceAccount)))
                            StrVarialble1      = record.(fieldnum(CustPackingSlipJour,InvoiceAccount));
                            StrVarialble1= record.(fieldnum(CustPackingSlipJour,OrderAccount));
                             documentTitle   = fileName("SalesPKSLP");
                             reportName      = reportstr(SalesPackingSlip);

Here its example of sales packing slip report print . You need to add new case in switch statement.

Sunday, August 2, 2015

Reporting extension installation error -Unable to back up the SQL Server Reporting Services encryption key for ax 2012 R3

Solution on below error

Problem and Error

Reporting extension installation error for ax 2012 R3.
Verifying the credentials for the Microsoft Dynamics AX .NET Business Connector proxy.
Back up the SQL Server Reporting Services encryption key.
The reporting server is not set up correctly, and cannot be configured by Setup. For information about setting up a reporting server, see SQL Server Books Online.
An error occurred during setup of Reporting Services extensions.
Reason: Unable to back up the SQL Server Reporting Services encryption key. The operation failed with error code 2147944645.
System.InvalidOperationException: Unable to back up the SQL Server Reporting Services encryption key. The operation failed with error code 2147944645.
at Microsoft.Dynamics.Setup.IdentityUpdater.<SetServiceAccount>b__2(ErrorCodes code)
at Microsoft.Dynamics.Setup.IdentityUpdater.CheckHresult(Int32 hresult, Action`1 exceptionAction)
at Microsoft.Dynamics.Setup.IdentityUpdater.SetServiceAccount(SrsWmi rsconfigSetting, String userName, String password)
at Microsoft.Dynamics.Setup.IdentityUpdater.UpdateSRS(SrsWmi rsconfigSetting, String userName, SecureString password)
at Microsoft.Dynamics.Setup.ReportsServerInstaller.SetInstanceIdentity(String instanceName, String sharePointServiceApplicationSite, String username, SecureString password)
at Microsoft.Dynamics.Setup.Components.ReportingServicesExtensions.SetInstanceIdentity(String instanceName, String sharePointServiceApplicationSite, String userName, SecureString password)
at Microsoft.Dynamics.Setup.Components.ReportingServicesExtensions.RunReportingSetupManagerDeploy()
An error occurred during installation of the Microsoft Dynamics AX Reporting Services extensions. See the installation log for details.
Registering tracing manifest file "C:\Program

1.Delete the .auc files and and registry key by command prompt.
2. The length of password while taking the backup of sql reporting encryption key should match with password policy length.if password policy length is 10 then the password while giving for encryption key length should be 10.otherwise it will throw the above error.
3. The account which we are using for reporting service extension password length should match with password policy length.
4. If still error exists then  uninstall the reporting extension and Sql reporting service  and re-install the same.
5.Try to reinstall reporting extension without configuration of reporting service it not success then configure one by one tab.
6. Take backup of encryption file at last and restore it.
7. Try to install reporting extension again if its installed with warning then try to deploy one report if its ok then you can proceed for other report deployment.

Active Search Results Technology Blogs