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.

Tuesday, December 1, 2015

Validate Name in Axapta

To Validate Name in Axapta  you can refer below code.
--------------------------------------Code block----------------------------
boolean validatestrName(str strName)
    Boolean valid,flag;
    System.Boolean flagTest;
    str matchstrNo = "^[a-z, ,A-Z]+$";

    System.Text.RegularExpressions.Match  myMatch;

    New InterOpPermission(InteropKind::ClrInterop).assert();
    myMatch =System.Text.RegularExpressions.Regex::Match(strName,matchstrNo);
    flagTest = myMatch.get_Success();
    flag = flagTest;

    if(strName == "")
        return true;
        return flag;
--------------------------------------End Code block-------------------------

Monday, November 30, 2015

SSRS Report deployment Error in Axapta

Error details;-

 On SSRS  Report deployment getting below error form ssrs deployment log file.

Deployment failed with the following exception:
System.Runtime.InteropServices.COMException (0x80040208)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Management.ManagementObject.Initialize(Boolean getObject)
   at System.Management.ManagementBaseObject.get_Properties()
   at System.Management.ManagementBaseObject.GetPropertyValue(String propertyName)
   at Microsoft.Dynamics.Framework.Deployment.Reports.SrsWmi.get_ConfigPath()
   at Microsoft.Dynamics.Framework.Deployment.Reports.ReportLibraryDeployer.DeployBusinessLogicAssemblies(IEnumerable`1 businessLogicAssemblies, DeploymentLogger logger)
   at Microsoft.Dynamics.Framework.Deployment.Reports.ReportLibraryDeployer.Deploy(IEnumerable`1 reportLibrariesToDeploy, IEnumerable`1 transitiveReferenceClosure, IEnumerable`1 cultures, DeploymentLogger logger, Func`2 connectionStringModifier)
Assemblies in app domain:


There are 2 solution for this error.
1. Disable UAC for user.
2. Run as Administrator for Report deployment.

I hope error gone by this trick.

Wednesday, November 4, 2015

Security Development Tools from Life cycle for Ax 2012

Security Development Tools from Life cycle for Ax 2012 help us to see effect of  roles, duties, and privileges.

You can download this tool from Dynamics life cycle services for Ax 2012 site. By using this tool you can easily test your newly create roles for forms,class,reports etc.

This is free Downloadable tools section of Microsoft Dynamics Lifecycle Services.You need to have Account of MSN login.

This tools  help you to save your time on test with different user login.

You can get more details for this from below mention link.

security devlopment tool beta

Friday, October 16, 2015

Backdate validation for user control in EP axapta

If you are seeking code for Backdate validation for user control in Enterprise portal page for  axapta then below code can help you.

Its tricky to find code on EP so its helpful for you.

 string cDate1 = DateTime.Now.ToString("dd/MM/yyyy");
 int flag = 0;
 Proxy.Info objinfolog = new Proxy.Info(this.AxSession.AxaptaAdapter);
 DateTime x;
 DateTime a;
Int32 r1;
Date1 = txtDate1.Text;

Ir = dsTestNewForm.GetDataSourceView("TestNewForm").DataSetView.GetCurrent().GetRecord();
        if (txtDate1.Text != "" && Ir.GetField("Date1").ToString() == "1/1/1900 12:00:00 AM")
             x = DateTime.Parse(cDate1, new CultureInfo("en-CA"));
             a = DateTime.Parse(Date1, new CultureInfo("en-CA"));
             r1 = DateTime.Compare(a, x);

            if (Ir.GetField("Date1").ToString() == "1/1/1900 12:00:00 AM" && r1 < 0 && Date1 != "")
                objinfolog.add(Proxy.Exception.Warning, "Back Date not allowed!!");
                flag = flag + 1;

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)));