Dynamics AX
  RSS Feed  LinkedIn  Twitter
Want to turn you're data into a true asset? Ready to break free from the report factory?
Ready to gain true insights that are action focused for truly data informed decisions?
Want to do all of this across mutliple companies, instances of Dynamics and your other investments?
Hillstar Business Intelligence is the answer then! (www.HillstarBI.com)

Hillstar Business Intelligence for Microsoft Dynamics AX and NAV on Mobile, Desktop, Tablet


Let us prove to you how we can take the complexity out of the schema and truly enable users to answer the needed questions to run your business! Visit Hillstar Business Solutions at: www.HillstarBI.com

Tuesday, September 20, 2011

AX 2012 and a look at some more complex Datacontract concepts and usage





With the release of Microsoft Dynamics AX 2012, one topic that I have been covering a good bit is around Services. There is good reason, and why a lot of other Dynamics Community bloggers and thought leaders have spent a lot of time talking about this topic. That reason, is the design importance that exists around services, and it's usage for an AX implementation. This is the new reality, and part of what makes AX 2012 Powerfully Simple.

As stated before, services are meant to be used internally and externally, with an AX 2012 solution. They enable some really great possibilities, and it's easier than ever to create, modify, and administer services than ever before.

One of the topics, I wanted to spend a little time on this evening, is around some more complex concepts for Data contracts, and the intended use within AX 2012.

There are a couple of points to cover here, and the first one is the proper code syntax for enabling a data contract, to have a property that is a list of child data contracts.

So to get to the meat of this area, the idea here is that you have a data contract. Within this data contract, you want to have a few properties that make up the contract, as well as a collection of other data contracts, that represent some business value, directly associated and therefore related to the parent data contract. I've mentioned before, in Microsoft Dynamics AX 2012 - A Dive into Services, Custom Services (Part II) post, about the use of Attributes to define data contracts with.

To enable this more complex need, Attributes in AX 2012 are very much a need in this case. To help set the stage for this review, we need a project, and two X++ classes.



You see in the above image, a project and two classes. A Parent and Child Data Contract X++ class. This is stated, visibly through the names of this classes, however, lets take a look at the make up of said classes.

First we need a parent class, this is the starting data contract, and so the following is the makeup of the parent data contract. I would like to point out that the following is not an image, but text, with some nice CSS that color and font the X++ to look like you see in the MorphX IDE.

So first we have the parent Class Declaration.:


[DataContractAttribute]
class idbParentDC
{
List _children;
str _someField;
}


After that we have two other methods we need to look at. This is a simple DataAttribute method, and then the more complex method that enables the storage of a collection, in our case a list, of Child data contracts.



[DataMemberAttribute("SomeField")]
public str parmSomeField(str s=_someField)
{

_someField = s;
return _someField;

}


So the above uses a simple DataMemberAttribute tag, that sets the property name of this given data contract, for the parmSomeField, equal to "SomeField". This is a very simple datatype of str, and therefore not much is needed in order to describe this method to AX so the proper WSDL is created.

Enter the more complex need, of working with collections. Since Microsoft Dynamics AX 2012 is not a strongly typed language, however it interacts with XML and WCF Services that demand collections be strongly typed a bridge or ability to create strongly typed collections must exist. What to do?

Here we continue the use of Attribute meta tags that are new to AX 2012, that define to the AX what the collection type is for coming into the class, and represented in being sent back for consumption back to the consuming entity of the given data contract.

So we have the following.:


[DataMemberAttribute("Children"),
AifCollectionTypeAttribute("l",Types::Class, classStr(idbChildDC)),
AifCollectionTypeAttribute("return",Types::Class, classStr(idbChildDC))]
public List parmChildren(List l =_Children)
{
_Children = l;
return _Children;
}


With the above we see the use of the AifCollectionTypeAttribute. This is being used to define the collection type, of list, containing a collection of idbChildDC objects. Also, since this method returns a collection, a List of object, the AifCollectionTypeAttribute, in turn is also used to describe the list of objects returned.

If you want to use such a concept, the above is a must. AX 2012 does not offer any flexibility in this regard, and if you don't correctly supply these AifCollectionTypeAttribute tags, the client will shut down on you.

Well that's all for now for this topic. With the above, you should be able to easily work with more complex concepts for Data Contracts in AX 2012. I will continue this mini-series of post, if you will, with taking the above and running it through the SysOperations Framework, and working with the SysPackable interface in AX 2012. That's all for now, till next time!

"Visit the Dynamics AX Community Page today!"


Labels: , , , , , , ,

Friday, September 02, 2011

AX 2012 Services, Services & Services - Recap Post



With the release of Microsoft Dynamics AX 2012, I and a few other community bloggers have been really talking up services. This started with a dive into services and from there has grew and grew.

To this end, I thought it would be a good time, to take and do a wrap up article, if you will, that ties together all these efforts that have been going on, to take and give a single point of entry for finding out about all things services. There is actually a lot more, in-depth coverage that needs, and will take place for this topic. However, for your ease, and enjoyment, the following is a list of post & articles that have been created to date.

First, a nice introduction into services.: A Dive into services.

Next up, we have the set of post I did, covering different concepts and ideas of services, that was built from the dive post.:


Now in some of my posting, I did write about the SysOperations Framework, or Business Operations Framework as the actual official product label for that said framework is stated. I had planned on doing the same kind of intro post around this framework as well, as it relates to services.

However, in the midst of all the writing, learning, and sharing some other great community bloggers have covered this to a good extent already, and so I will link to those resources here.

SysOperations from Fellow Bloggers:
-AX2012: SysOperation part 1: Data Contracts and Service Operations
-AX2012: SysOperation part 2: SysOperationServiceController
-AX2012: SysOperation part 3: SysOperationAutomaticUIBuilder

And
-From RunBase to SysOperation : Business Operation Framework
-From RunBase to SysOperation : Business Operation Framework (Cont'd)

With all of this, it should be looked, really as a nice introduction to the concepts, and abilities of AX 2012, for making use of SOA, or services for internal and external use. This will only continue to grow, so it's ever so important that these concepts be understood now, and implemented in today's AX 2012 projects.

Look for more depth, and deeper dives into some of these concepts in the weeks to follow. That's all for now however, for those of you in the U.S. enjoy your long weekend! Till next time!




"Visit the Dynamics AX Community Page today!"


Labels: , , , , , , , , , ,

Monday, July 18, 2011

Microsoft Dynamics AX 2012 - Business Operations Framework and the start of Services Abstraction with AX



With Microsoft Dynamics AX 2012, a new system service type exists. This is the Business Operation Framework (BOF) [AX 2012]

From the MSDN Home:
"The Business Operation Framework service is one of the system services exposed by Microsoft Dynamics AX and that adheres to the Windows Communication Foundation (WCF) protocols and standards. This service enables you to ... "

I love the "..." because, this shows the MSDN home for the new Business Operations Framework (BOF), is not actually complete. What's important to understand however is what this represents.

This is the start of what I talked about years ago with Lachlan Cash for Microsoft, with the following post.: WCF: The Enterprise Service Bus for Dynamics AX and the rest of the Microsoft Stack.

What I mean by this, is the fact, that the new Business Operation Framework it the fruit of all the work that Microsoft has invested in being able to have SOA communication between modules, and specifically between elements of code within Microsoft Dynamics AX 2012 and beyond.

This is making use of AIF, and Services, within the context of AX itself, and doing so, is the stepping stones to enabling the future flexibility of being able to have a true hybrid cloud that takes and enables bits and parts of AX to live on-premise, or in the cloud, and to the end user they have no clue which is which, because it does not matter to that level.

Understanding the impact of what this new development means, and what this offering can enable, is so very important today. This means, that new development, can take advantage of such offerings, and there is much more benefit than just future enabling your scope of work.

Check out the following MSDN articles.:

Just check this out.:
"Business Operation Framework (BOF) lets you run services on Microsoft Dynamics AX using the Windows Communication Foundation (WCF) framework. Business Operation Framework services have a clear separation of responsibilities between tiers. Dialog boxes are presented on the client tier, execution occurs on the server tier, and parameters can be accessed by both the client and server tiers. Business Operation Framework services can also increase efficiency by reducing round trips between client and server. "

And...
"Business Operation Framework services are flexible. BOF services can be executed in a job, as menu items, and as batch operations. BOF Services can also be executed synchronously or asychronously. "

I plan on taking this topic a lot further, with giving some real world examples, and comparisons with this approach, vs. standard development and execution. I hope this has really peaked your interest, and this design approach should be consider for use with anyone doing any development work within Microsoft Dynamics AX 2012.

That's all for now, but check back soon, as so much more to come! Till Next Time!



"Visit the Dynamics AX Community Page today!"

Labels: , , , , , , , , , ,


Copyright 2005-2011, J. Brandon George - All rights Reserved