April 06, 2013

UTC DateTime Null Value in Ax

UTC DateTime Null Value in Ax

Some times we need to pass or check null value in UTCDateTime field.
so here is the logic to pass null value in UTCDateTime,

just try utcdatetimenull() function in your code, it will return the same value as 

DateTimeUtil::minValue() function.

In X++ The utcdatetimenull() value is '1900-01-01T00:00:00'.

-Harry

April 04, 2013

Finding unused lables

Finding unused labels in Axapta

Here is a small job for finding labels, from a particular label file, that are not used in your whole application code. You need an updated cross reference to use the job. I assumed that you are familiar with label files.


static void findUnXedLabels(SysOperationProgress _progress = null)
{
    Label     label       = new Label('da');// The languageto use for finding the labels
    str 250   labelId     = label.searchFirst('');
    Map       mapLabels   = new Map(types::String, types::String);
    MapEnumerator   mapEnumerator;
    ;

    setPrefix("Finding UnX'ed labels");

    while (labelId)
    {
        if (label.moduleId(labelId) == "XYZ") // The particular label file
        {
            if ((select xRefNames
                     index hint Name
                     where  xRefNames.Kind == xRefKind::Label &&
                            xRefNames.Name == labelId &&
                            xRefNames.TypeName == '').RecId == 0)
            {
                mapLabels.insert(labelId, label.extractString(labelId));
            }
        }
        labelId = label.searchNext();
    }

    // The maps is used to sort the lables
    mapEnumerator = mapLabels.getEnumerator();

    while (mapEnumerator.moveNext())
    {
        info (strFmt("%1 %2", mapEnumerator.currentKey(), mapEnumerator.currentValue()));
    }
}

In standard AX you can run this check for all labelfiles and save the result to a file, by using the \Classes\SysApplCheck\findUnXedLabels method.
-Harry

Large collection of Free Microsoft eBooks for you, including: SharePoint, Visual Studio, Windows Phone, Windows 8, Office 365, Office 2010, SQL Server 2012, Azure, and more.

Large collection of Free Microsoft eBooks

http://blogs.msdn.com/b/mssmallbiz/archive/2012/07/27/10334262.aspx

http://blogs.msdn.com/b/mssmallbiz/archive/2012/07/30/another-large-collection-of-free-microsoft-ebooks-and-resource-kits-for-you-including-sharepoint-2013-office-2013-office-365-duet-2-0-azure-cloud-windows-phone-lync-dynamics-crm-and-more.aspx?wa=wsignin1.0


-Harry

April 03, 2013

AX 2012 Developer Resources

AX 2012 Developer Resources

In this post i am sharing AX 2012 resources links, including development helps, Downloads, Articles  Blogs. All links are grouped by Topic
 

Events
Introduction
Eventing Basics (code walkthrough)
Managed Handlers for Pre/Post events (code walkthrough)
Managed Code Handlers for Delegates (limitations) (code walkthrough)
Microsoft Whitepaper: Eventing (download)
Eventing Terminology and Keywords (MSDN Article)
Naming Conventions for Delegates and Event Handlers (MSDN 

X++ Language
X++ as a Managed Language in the .NET Runtime (code walkthrough)
AX 2012 X++ Language Changes, Stricter Syntax (MSDN Article)
.NET Interop to X++ Issues when X++ runs as CIL (MSDN Blog)
Deploying AX 2012 Code
New Query Object Features (code walkthrough)
Creating Code Snippets and method templates (code walkthrough)


Data Access
Computed View Columns (code walkthrough)
Valid Time State/Date Effective Framework - Part 1: Creating the table (code walkthrough)
Valid Time State/Date Effective Framework - Part 2: Querying time state tables (code walkthrough)
Microsoft Whitepaper: Using Date Effective Patterns (download)


Debugging
Debugging X++ Running in CLR using Visual Studio (code walkthrough)



General Topics
Microsoft Guide: What's New for Developers (download) [fixed link - thanks to reader Waldemar Pross]
Microsoft Guide: New, Changed and Deprecated Features (download)
Microsoft Whitepaper: Deploying Customizations Across Environments (download)
Dynamics AX 2012 System Requirements (download)
Deploying AX 2012 Code
Importing Data Using the Excel Add-Ins



Reporting
Multiple instances of Reporting Services on the same machine (TechNet Article)
Microsoft Whitepaper: Report Programming Model for Dynamics AX 2012 (download)


SysOperation Framework
From RunBase to SysOperation: Business Operation Framework (code walkthrough)
From RunBase to SysOperation: Business Operation Framework (SysOperation query and customizing BOF dialog) (code walkthrough)
MSDN SysOperation Framework (MSDN Article)
SysOperation Framework Whitepaper (download)


UnitOfWork
Unit of Work Magic (code walkthrough)


Table Inheritance
Microsoft Whitepaper: Developing with Table Inheritance (download)


Model Architecture
Models and Layers Basics (code walkthrough)
Powerful Combination of Models and Events for No-Merge Code Solutions (code walkthrough)
Deploying AX 2012 Code


Managed Code
Using Visual Studio 2010 with AX 2012 (code walkthrough)
Writing and Calling Managed Code from AX (code walkthrough)
Limitations for Managed Code Event Handlers (code walkthrough)
Proxy Classes Gotcha (code walkthrough)
Creating Proxies for Kernel Classes (classes not visible in the AOT) (code walkthrough)
Microsoft Whitepaper: Selecting the Best Development Technology for Your Scenario (download)
X++ as a Managed Language in the .NET Runtime (code walkthrough)
.NET Assembly Deployment in AX 2012
.NET Interop to X++ Issues when X++ runs as CIL (MSDN Blog)


Services
From RunBase to SysOperation: Business Operation Framework (code walkthrough)
Using System Query Service in WPF (code walkthrough)
MSDN Business Operation Framework (MSDN Article)
Microsoft Whitepaper: Services (download)
Consuming External Webservices (code walkthrough)
Trusted Intermediary in AIF (code walkthrough)


Security
Trusted Intermediary in AIF (code walkthrough)
Microsoft Whitepaper: Developing Extensible Data Security Policies (download)
Microsoft Whitepaper: Using The Policy Framework (download)


Various
10-minute AX 2012 App: WPF (code walkthrough)
10-minute AX 2012 App: Windows Azure (code walkthrough)
10-minute AX 2012 App: Windows Phone 7 PART1 (code walkthrough)
10-minute AX 2012 App: Windows Phone 7 PART2 (code walkthrough)
10-minute AX 2012 App: Windows Phone 7 PART3 (code walkthrough)app.html


Foreign-Key Table Relationships
RecIds as Foreign Keys (code walkthrough)
Microsoft Whitepaper: Migrating EDT Relations (download)
-Harry