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

Wednesday, January 18, 2012

AX 2012 - Using Financial Dimensions when Creating Products





I hope everyone is having a great week so far, and your knee deep into your Dynamics AX projects. I wanted to take a little time this morning, and post a bit about the use of Financial Dimensions when creating products in AX 2012.

I covered the creation of products, using the EcoResProductService, in the following post: Microsoft Dynamics AX 2012 - A Dive into Services, Consuming Document Services



What I did not cover in this post, is around the filling of the DefaultDimension field, from the InventTable object, during the Releasing of a Product to a legal entity, via the InventItemService. Since the time of that posting, I've had a chance to work with this further, and wanted to share, how you would go about, still using these document services, to assign the Default Dimension for a Released Product.



With the understanding we have from the previous post, we need to know understand our starting point for being able to set the Default Dimension value, for a released product. There is a set of classes, that are apart of the AIF class framework within AX 2012, that enable us to build up the default dimension for a specific released products. These are: AifDimensionAttributeValueSet & AifDimensionAttributeValue.

Also as part of this Dimension value set creation process, there is a need to work with the AfStronglyTypedDataContainerList, which is a container for the AifDimensionAttributeValue objects we build up for setting our product dimension values.

So since this is our starting point, we would need to define these, in the header section of whatever method or job is performing the action of releasing creating products. We would then, have something that looked like the following code.:


// DefaultDimension variables:
AifDimensionAttributeValueSet DefaultDimSet;
AifDimensionAttributeValue dimensionAttributeValue;
AfStronglyTypedDataContainerList dimensionAttributeValues;


With this, we know have the variables needed, in which we can use, along with the InventItemService for setting our Default Dimensions. Moving forward then, within this concept, and assuming you've already got the code from the previous post, lets work with these objects and see the process of creating our Default Dimensions.



// Set DefaultDimension data
dimensionAttributeValues = new
AfStronglyTypedDataContainerList(#AifDimensionAttributeValue);

dimensionAttributeValue = dimensionAttributeValues.addNew();
dimensionAttributeValue.parmName("Department");
dimensionAttributeValue.parmValue("SomeValue");

dimensionAttributeValue = dimensionAttributeValues.addNew();
dimensionAttributeValue.parmName("Purpose");
dimensionAttributeValue.parmValue("SomeValue");

dimensionAttributeValue = dimensionAttributeValues.addNew();
dimensionAttributeValue.parmName("CostCenter");
dimensionAttributeValue.parmValue("SomeValue");

invTbl.createDefaultDimension().parmValues(dimensionAttributeValues);


With the above code example, we can see that via the InvTable variable, which represents an InventItem_InventTable object, we can create our DefaultDimensions, as well as fill in the Financial dimension name as well as value. In doing this, we are now able to set default financial dimensions correctly, for products we are releasing to a specific legal entity.

To help with this topic further, Becky Newell, a super star support engineer for Microsoft, gave us an early Christmas Present this past Dec., in which she gives us code example of working with Financial dimensions, for Journal Entries. You can find that post, at the following: Creating General Journals in AX 2012 in X++.

Well thats all I have time for this post, I hope this helps you out, and futher shows the powerfully simple nature of AX 2012, and the ability to work with the infinitely possible financial dimensions that can exists. Till Next time!



Visit Hillstar Business Intelligence (www.HillstarBI.com) in order to truly unlock your data trapped in your Microsoft Dynamics investment. With our value driven business intelligence strategy Hillstar help you transform into a data informed company.


Follow Me @:
RSS Feed  LinkedIn  Twitter

"Visit the Dynamics AX Community Page today!"

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

Tuesday, December 20, 2011

AX 2012 - Items & InventItemSetupSupplyType Table





In past post, I've covered the usage of services for performing operations external to AX, as well as internal.

Some examples that have done recently, were focused around Creating Products in AX 2012, via the EcoResProductService.



As well as creating the new Trade Agreements, via PricePriceDiscJournalService.



The point that I've tried to get across in these examples, is to show how this can be done within AX 2012, as well as the same concepts and constructs can be used externally of AX 2012. This is the right move, specifically if your looking beyond AX 2012, and beyond AX7 even.

With this concept, you can also Release Products to a specific legal entity, which is covered pretty well, via a C# example, found at the following resource.: Product-item data management services.

So again, we see how both X++ and C# can use these constructs, Document Services, to create products, as well as release them to a specific legal entity. With this said, there is something missing, for this process.

Specifically, if we look to have our migrated products, that have been released, to show up on the Purchase Order Lines, Item Id field drop down. If we go to do this, and we created products, and released them for use within a specific legal entity, via the services described in the above references, then our items would not show up for use on Purchase Order lines. They can be entered, but do not show up.



The reason this is the case, is because in AX 2012, the Purchase Order Line, Item Id datasource field, has a new lookup() form it uses, called InventItemIdLookupPurchase. This form, has a datasource, that includes the new table: InventItemSetupSupplyType. [InventItemSetupSupplyType Table [AX 2012]]

This new table, contains sourcing information, related to the Item that is being released to a specific legal entity. When this release takes place, the AX Rich Client UI, will fire the EcoResProductReleaseManager object that has logic which creates a default entry into the InventItemSetupSupplyType table, with a Default Order Type of Purchase.

When creating products and releasing them through the services, specifically for the InventItemService, [InventItemService Class [AX 2012]], it makes use of the AxdItem Query object in AX 2012, in order to create records via.



Since this is the case, and we can see from above that the InventItemSetupSupplyType table does not exists as a datasource, then when creating records via this design concept, will not satisfy the requirement of adding entries into the new table, of InventItemSetupSupplyType.

Therefore, there is a small disconnect between the UI release process, and the document service approach for creating and releasing items. This is a simple fix however, either invoke similar code, found in the EcoResProductReleaseManager class for the createInventItemSetupSupplyType() method. Or the other option, could be to add the datasource, to the AxdItem query, for the InventItemSetupSupplyType table, and regenerate the InventItemService, document service, so it will reflect the new entity within it's WSDL.

Depending on the scope of what your doing, should guide you on which choice you make here. If it's throw away, migration code, the simple, fast option of just invoking the X++ code that lives within the EcoResproductReleaseManager class would be advised.

However, if your doing a longer, value add modification, or integration, then, looking to modifying the InventItemService, via the AxdQuery object should be considered.

Well I know that's a little deep dive, on something very specific, however such deep dives are warranted at times. I believe, it's important to understand this, from a process point of view, but also see the value in showing choice. The ability to solve a need, there is multiple ways. Depending on where the most value is, should guide your choice, for the design and the development of answering a specific scope need.

That's all for now, but check back soon as a whole lot more to come. Till next time!

Follow Me @:
RSS Feed  LinkedIn  Twitter

"Visit the Dynamics AX Community Page today!"

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

Sunday, December 11, 2011

AX 2012 - Using the PricePriceDiscJournalService





I hope everyone is enjoying their weekend. I hope you have gotten some downtime, and are ready to kick off a new week! To help get things started right this week, I thought I would give some specific focus to one of the out-of-the-box services that comes as part of Dynamics AX 2012.

The service I'm talking about, is the PricePriceDiscJournalService

This service is what you should use, when needing to work with Trade Agreements, via code, inside or outside of AX 2012. As I've mentioned before, around the topics of Services, document services should be used internal and external of AX 2012, as much as possible. This services abstraction has benefits now, with AX 2012 and what comes with the AIF Document Framework. It also holds values, for the future, as Dynamics ERP scales to Azure with AX 7.0, and beyond.

With this in mind, we need to then start with how to use this service, from within AX itself, via X++ code. We have reviewed a similar topic before, in which I talked you through the consumption of the EcoResProductService.



Working with the PricePriceDiscJournalService is similar, in the type of objects you need to create, and make use of. All, relating and apart of the AIF Framework.

There is a functional setup part to this service, in which needs to be understood for proper execution. With AX 2012, Trade Agreements, for Sales Prices, Discounts, etc. must be first created as a Journal, and then posted. Since this is the functional workflow, and therefore functional requirement, AIF has to know which price journal name should be used, during the operations of the service.

This is enabled through the setup parameters, of the Procurement & Sourcing Module. You can navigate to this location, by going to Procurement & Sourcing > Setup > Procurement & Sourcing Parameters. In navigating to this location, there is an AIF smart tab, that appears on the left hand of the parameters form. Clicking on this, will take to you where you select which Journal Name to make use of.



The possible overlooked value in this setup, and use of a default journal for AIF price entries, is it can allow for a degree of separation. In that, the ability to have easily all the prices and discounts that are coming in through AIF, can be separated from other price journals.

Now having this set, we can now move forward with our use of the PricePriceDiscJournalService. In order to show this off, lets start with a simple job, in a new project. This job, will be what shows off our X++ example code.



Now that we have our job, lets take a look at the following code, and break it down for it's use.

static void idbExecutePricPriceDiscJourSvcJob(Args _args)
{
// PricePrice Vars
PricePriceDiscJournalService PriceDiscSvc;
PricePriceDiscJournal PriceDiscJour;
PricePriceDiscJournal_PriceDiscAdmTrans PriceDiscJourAdmTrans;
PricePriceDiscJournal_InventDim PriceDiscJourDim;

// keys return from create process
AifEntityKeyList keys;

// Instantiate the objects
PriceDiscSvc = PricePriceDiscJournalService::construct();
PriceDiscJour = new PricePriceDiscJournal();
PriceDiscJourAdmTrans = PriceDiscJour.createPriceDiscAdmTrans().addNew();
PriceDiscJourDim = PriceDiscJourAdmTrans.createInventDim().addNew();

// Set PriceDiscJourDim
PriceDiscJourDim.parminventDimId(InventDimCombination::
findByDistinctProductVariant(
EcoResProduct::findByDisplayProductNumber(
"SomeProductVariant").RecId)
.InventDimId);

// Set PriceDiscJourAdmTrans
PriceDiscJourAdmTrans.parmInventDim().add(PriceDiscJourDim);
PriceDiscJourAdmTrans.parmItemRelation("SomeProduct");
PriceDiscJourAdmTrans.parmItemCode(TableGroupAll::Table);
PriceDiscJourAdmTrans.parmAmount(100.00);
PriceDiscJourAdmTrans.parmFromDate(today());
PriceDiscJourAdmTrans.parmAccountCode(TableGroupAll::All);
PriceDiscJourAdmTrans.parmrelation(PriceType::PriceSales);
PriceDiscJourAdmTrans.parmCurrency("USD");

// Post PriceDiscJour
keys = PriceDiscSvc.create(PriceDiscJour);
}


With the above code, we can see that we are now working with the PricePriceDiscJournalService, and using the AIF Entity objects, in order to create a Price Journal, that represents a ready to be reviewed, and posted Trade Agreement.

Just to break down, first we start off we Instantiate an instance of the needed objects. This includes the service, PriceDiscSvc. Also, the PriceDiscJour , PriceDiscJourAdmTrans & the PriceDiscJourDim. All of which are a part of the AIF Framework. The PriceDiscJour extends from AIFDocument, as the other two PriceDiscJourAdmTrans & PriceDiscJourDim extends from the AfStronglyTypedDataContainer class.

These are critical in filling out the information needed, for the PricePriceDiscJournalService to properly create a brand new Trade Agreement journal.

From here we can see that I fill the PriceDiscJourDim first, as it is then added tot he PriceDiscJourAdmTrans. This is then filled in the rest of the way, and in turn itself ias added to the PriceDiscJour object.

Finally the PriceDiscJour Object, is sent as the needed variable for calling the create() service operation of the PricePriceDiscJournalService, represented by the PriceDiscSvc variable within the example code.

With this, we can now create Price Journals, that can be reviewed and posted. These can be viewed from the Procurement & Sourcing Module > Journals > Price / Disc. Agreement Journals.



Well that's all for this post. I hope you have enjoyed it, and find it useful. Moving forward from here, if your importing data, and not needing a review the next step would be to post the journal, after the creation of it. That, is a nice little topic for a future post.

Till next time!



Visit Hillstar Business Intelligence (www.HillstarBI.com) in order to truly unlock your data trapped in your Microsoft Dynamics investment. With our value driven business intelligence strategy Hillstar help you transform into a data informed company.


"Visit the Dynamics AX Community Page today!"


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

Tuesday, October 25, 2011

AX 2012 - Excel Add-in Revisited





With the release of Microsoft Dynamics AX 2012, came some great new ways of achieving business requirements, and user experiences. One of those is the Excel Add-in for Microsoft Dynamics AX 2012. I first wrote about this topic, back in June, in which you can find here: Microsoft Dynamics AX 2012 Excel Add-in. This has been a hot post actually, with a lot of comments, and a lot of visits.

It's rightfully so that it should be, being that it's new, and there is some confusion on how to do some of the more complex data sets, within AX, that go beyond just a simple table, which that first post covered for us. With that in mind, I thought I would help clear the air a little bit, in how the Excel Add-in is actually very flexible, and something to watch out for in December from Microsoft on this topic.

First, lets look at the starting point, in which we can start to work with more advanced data sets in AX. This concept, is enabled through the use of document services. This is the way, in which complex data sets in AX are exposed internally and externally of AX 2012. This is true, even for the Excel Add-in.

From the excel point of view, what we are talking about is the Add Data ribbon button, and when the drop down appears clicking on the Add Data, instead of Add Tables.



When clicking on this, for the first time, if you've not setup any Document Data Sources within AX 2012, your selection options will be blank. Now we have talked a little bit about this new concept of Document Data Sources, in the following post.: AX 2012, PowerPivot and a Dash of OData Feeds

In that above post, I covered with you how to enable Excel 2010 PowerPivot to work with OData Feeds from AX 2012. This was enabled through having Query Type of Document Data Sources enabled through the Organization Administration module, Setup, Document Management and finally Document Data Sources.



Here we can also add a document data source, of type service. These services must be document services and extend from the AIF Document Services types. These can not be custom services that do not extend as part of the AIF document services.

With that in mind, we can add a couple of document services, to our list, from within that form, as seen below.



Now that we have these services as document data sources within AX 2012, we can now go back to Excel 2010, within the Excel Add-in and click on our add data, and see our two new services we can make use of.



With this, now we can work with more complex data sets within AX 2012. This also means, that Office 2010, very much is a major part of the user experience in regard to AX 2012. This also means, that some very complex data set needs, can be accomplished through the use of Query Objects, and Document Services that wrap those query objects to expose them internally and externally of AX 2012.

With this said, there are some issues, and area's to watch out for. Basically, there are some super normalized data sets, like customers, vendors, etc. To help address those needs, Microsoft will be releasing in December a resource kit, that will contain artifacts that help enable the use of the Excel Add-in, for the master data, that has some super normalization aspects to it, that make it a little harder to work with from Excel. The basic concept will still be used that you see above here, that will be enabled with staging tables that the process will still use document services to enable.

I hope this helps further explain the value of the Microsoft Dynamics AX 2012 Excel Add-in and how it can be used right now with even more complex data sets, than just simple tables. You enable this through the use of Document Services. Also, it's very important to understand that Microsoft will be releasing that resource kit to help out with some of the super normalized master data elements. Finally, you can create your own document services, that wrap your own custom data sets, or query objects, that in turn can be consumed and made use of in a bi-directional nature through Excel. This is a huge benefit to customers of AX 2012, and something that needs to be considered when thinking about designing and developing scope for customer.

That's all for now, check back soon as more to come. Till next time!

"Visit the Dynamics AX Community Page today!"


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

Friday, October 07, 2011

Freaky Tech Friday - It came from another Platform





With it being October, one of my favorite times of the year, I thought it would be nice to have a fun, but informative series of post title: Freaky Tech Friday. This series of post, will be about Microsoft Dynamics AX 2012, and how other technologies, from other platforms, other planets, and other dimensions can be used. Maybe not so much other planets or dimensions, but you get the idea.

With that, lets start this creepy stroll down the dark alley of interopability that exists with AX 2012. The once scary path, that was filled with gotcha gremlins, and barrier trolls, now has become not such a scray place. What I'm talking about here, is not the net.tcp consumption of Services hosted within the AOS itself, but extending this, so that other platforms can consume these services through hosting end points through IIS.



From the above system architecture we would be focusing our efforts on the hosted WCF services within IIS. These services are really pointers, to the same X++ based artifacts that live within an instance of AX. This is how advanced end points can be enabled, that, say would allow Java based software, python, Objective-C, and other possible technologies that come from other platforms could consume directly these services, or at least be enabled to do so.

To help us getting started down this dark path, of creating a solution-stien architecture, we need our first lesson to be focused on how to enable the hosting of Services within IIS for AX 2012. To start, we need to read and understand the following.: Install web services on IIS [AX 2012]

"Web services on IIS is an optional component. The Application Object Server (AOS) is the Windows Communication Foundation (WCF) service host for Microsoft Dynamics AX services. The AOS-hosted services are available to users and applications across the Intranet. To consume services over the Internet, you must host services on Internet Information Services (IIS). Skip this procedure if you do not need to expose the Microsoft Dynamics AX services over the Internet."

Now I want to be clear, that for non-Microsoft platform technologies, even within the intranet, consumption of the WCF services will need to most likely take place via hosting the services on IIS. This is related to the use of AOS hosted services being offered up via net.tcp bindings. Understanding this fact, will help you in enabling this other worldy technologies from another platform, communicate and work with AX 2012 services.

Following the above referenced TechNet article through, we can see how to setup our services, so they can be consumed by internet external consumers, as well as other technologies that need more enhanced integration port bindings.

Well I think thats enough to scare almost anyone, on this Freaky Tech Friday post. Tune in next week ghosts and ghouls, as we take this further, and go past the point of no return, into the abyss of integration! Scare you then!

"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: , , , , , , , , , ,

Tuesday, August 30, 2011

Microsoft Dynamics AX 2012 - A Dive into Services, Consuming Document Services



With the release of Microsoft Dynamics AX 2012, one of the topics I have been spending a lot of time talking about is around services. There is good reason for this, and we will continue to dive deeper and deeper into the concepts, the reasons for use, and examples of use.

Last I left off, we covered topics related to Custom Services. In this post, I want to take and cover concepts around the consumption of document services.

As I referenced in a previous blog post, there is a great write up already, that covers the technical steps needed to show off how to consume document services, specifically around the Product Data, or the EcoResProductService.

This write up, found here: Product-item data management services, focuses on the consumption of the EcoResProductService, among others, for creating product data, and even releasing that into a given legal entity. Since this is a very nice write up, I will not focus this post on repeating the same effort.

Instead, what I want to focus on, is consuming the EcoResProductService, from within X++, from within AX, for creating Product Master Data. So lets jump right into this.

First thing that we need is an instance of AX 2012, and a project. We will then need, within that project, a custom service group to deploy the out-of-the-box EcoResProductService via. After that, we will need a class, to contain the business logic, and finally for our example a job that kicks off that classes method, and therefore logic for creating our Product Master.



As you can see, from the above image, we have just that for our example. Now since there is nothing we need to really do to the EcoResProductService, lets move into the business logic for creating a Product Master record.

First we need to start with the variables that will be involved in, enabling this.:



You will notice, we have an EcoResProductService variable, which is used to perform the operations that are enabled for a given service, in this case document service, and for our need the create() function.

Next you will see we have a variable that presents the EcoResEcoResProduct object. This is what the EcoResProductService will accept in it's create call that we will see in a bit. This class extends from the AifDocument class, as you can see from the below image.



After that, we have EcoResEcoResProduct_Product_Master class, which is extends from the EcoResEcoResProduct_Product class, which further extends from the AfStronglyTypedDataContainer. You can see this as well, in the image below here.



From there we have variables that represent the EcoResEcoResProduct_Translation, EcoResEcoResProduct_Identifier & EcoResEcoResProduct_ProductDimGroup objects. All of which are used to help make up an EcoResEcoResProduct_Product_Master object.

Now all of that is a mouth full! The point is, we have, in order to work and create Product Master entries, via the Document Services concept, is six objects. These six objects in our example abstract the complexity of the new EcoResProduct data structure, and enable within AX for business logic to move away, from even working directly with the table objects within AX itself. This is very powerful, and very useful.

Now lets move forward, since we have an understanding of the objects that will enable us to create a Product Master record, and look into the code that enables this.



First part of the code, we see in the above image, our logic that initializes the service for use. Then we move towards creating a new instance of the EcoResEcoResProduct object. After that we are creating our Product Master object, and finally filling some of it's parameters, via the use of parameter methods, with values.



Next we are making use of the objects that make up our Product Master object, in the ProdMast variable, for creating the needed: Translation, Identifier and for our example the Product Dimension Group.

You will notice that the code to enable this is ProdMast.createTranslation().addNew(); In doing this, and for the other examples this is true as well, we are creating a new instance of the Translation object, and adding it to the AfStronglyTypeDataContainerList that is represented for the ProdMast variable.



Finally, we come to the bottom of the code block for this business logic, and see we are setting the Variant Configuration Technology. Then adding our ProdMast object to the Strongly Type List for the EcoResProd variable. Finally calling the create method of the service object, passing in our ProdMast variable.

On calling this logic, we get our Product Master record, as shown below.:


So with a total of 17 lines of code, and 6 objects, we are working with Document Services from within AX 2012 itself, and creating Product Master data, without having to work directly with the table objects themselves.

This can then lend itself to be re-used over and over again, and finds value in integration work, as well as data migration. You can also, now take and compare the differences between C# and X++ code for using these document services. They are similar, in theory, but different in syntax and possible approach of course.

That's all I wanted to cover for this series, and for the introduction to services in AX 2012 this just about wraps things up. I plan on doing a summary post, bringing together all the work I've done, all the work Microsoft has done, as well as other community contributors. Till next time!



"Visit the Dynamics AX Community Page today!"


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


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