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


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