Monday 30 May 2016

Add All Objects To TFS


static void versionControl(Args _args)
{
    UtilElements   utilElements;
    TreeNode       treeNode;
 
    //Desired Layer
    UtilEntryLevel utilEntryLevel = UtilEntryLevel::var;
 
    //This container is important, so you don't add a single classMethod to versionControl,
    //If you do that, you are going to have some trouble to check-in them.
    container      conElementType = [UtilElementType::Class,UtilElementType::ConfigurationKey,
                                    UtilElementType::Enum,UtilElementType::ExtendedType,
                                    UtilElementType::Form,UtilElementType::Macro,
                                    UtilElementType::Menu,UtilElementType::Report,
                                    UtilElementType::SecurityKey, UtilElementType::SharedProject,
                                    UtilElementType::Table, UtilElementType::ActionTool,
                                    UtilElementType::DisplayTool, UtilElementType::OutputTool];
 
    //Checking if the recordType is inside the valid container
    boolean isValidForVersionControl(UtilElementType _type)
    {
        return confind(conElementType,_type);
    }
    ;
 
    //If the Version Control is not enable, it does not
    // make sense to add elements to it
    if(SysVersionControlParameters::isVCSEnabled())
    {
        //Iterate over the elements of an specific layer
        while select utilElements
            where utilElements.utilLevel == utilEntryLevel
        {
            //Validate if the UtilElment is to be addded to the versionControl
            //based on the recordType field
            if(isValidForVersionControl(utilElements.recordType))
            {
                //Get the AOT tree node
                treeNode = xUtilElements::getNode(utilElements);
 
                //Used to check if it is already added and other stuff
                if(versionControl.allowCreate(treenode))
                {
                    //Call to the VersionControl Appl class, already instantiated by the client
                    versioncontrol.create(treeNode);
                }
            }
         }
     }
     else warning("Version Control not enabled");
}
 
Comment
 
\Classes\SysTreeNode\canCreate
 
 
/*if (!SysTreeNode::existsInLayer(this.parmTreeNode(), currentLayer))   // check if sub-elements' layer is in layer mask
    {
        error(strFmt("@SYS127511", this.parmTreeNode().treeNodePath(), currentLayer));
        return false;
    }*/
 
 
 

Friday 27 May 2016

AX SSRS Report times out after 10 minutes (Error: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond)

Sometimes when running a report that is going to return a large data set you may get the following error message after 10 minutes:

"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"

Whenever you receive this error the first thing you should look at is your DP class and can performance be improved by rewriting some of your code. If it cant be or this is a default ax report sometimes your only option is to increase the default timeout period.

In order to increase the timeout for an AX SSRS report you need to do the following:

1.) Create a new client config(or copy an existing one.) This is the same config that could be used as your .axc file that is used to access different environments/aos. However this will have larger timeout values in it so only use this on the server mentioned in step 4. You do not need your user's applications config to have these settings.

2.) Update the binding node of "QueryServiceBinding" and change the sendTimeout property from "00:10:00" (10 minutes) to whatever timeout value you like in hh:mm:ss format. You can also update any other timeout setting as well if you like. (Just search for 00:10:00 within the document and replace it with your new time)

3.) Save the new config as  "Microsoft.Dynamics.AX.ReportConfiguration.axc"

4.) Copy the new file Microsoft.Dynamics.AX.ReportConfiguration.axc into the following folder on your sql/ssrs server (inside of the os/windows file system)

C:\Program Files\Microsoft SQL Server\MSRS11.<AOS>\Reporting Services\ReportServer\bin

Note: This is for a sql2012 instance. If you are running a different version of ms sql please refer to the following TechNet article to find the location of your report server bin folder https://technet.microsoft.com/en-us/library/hh389774.aspx if you need help locating it.

5.) Run the report and the report should no longer time out. You do not need to restart the aos, sql or ssrs services in order for the changes to take place once the file is in this folder it should now respect your new timeout settings