Showing posts with label Dynamics ERP 2012. Show all posts
Showing posts with label Dynamics ERP 2012. Show all posts

Friday, January 4, 2013

Business Benefits of Microsoft Dynamics AX 2012 R2

 
 
Hi There!
 
As we all very well know by now, the release of AX 2012 R2 (You can get more informtion about AX 2012 R2 on the What's New in Microsoft Dynamics AX 2012 for Developers) came to a reality last December, and I wanted to share the four most important business benefits of this release.
 
You can access the original post here, which was written by the Microsoft Dynamics AX Product Team.
 
New functionality for Industries and Administrative Processes
  • Manufacturing: Improve manufacturing operations for process manufacturing. AX 2012 R2 introduces new capability for management of potency, traceability and product batch sequencing to help process manufacturing streamline operations.
  • Retail: Assorment management across channels in your retail operations. New multi- and cross-channel capabilities for retail organizations, including catalogue management, cross-channel workflows, and integrated sales channel management will include a new “out of the box” web storefront.
  • Public Sector: AX 2012 R2 simplifies the financial budgeting process in public sector organizations. By combining the power of Microsoft Excel with the power of the workflow engine inside of Microsoft Dynamics AX 2012, AX 2012 R2 supports new capabilities in budget formulation with workflow approvals, flexible tracking, and reporting.
  • Professional Services: AX 2012 R2 improves in the intercompany scheduling capability of project resources will specifically benefit services organization with resources and projects across multiple entities and will improve utilization of your resources.

Improve Business Insights for all Users

New and updated KPI content is offered, and updated KPIs will come with the SQL BI cubes shipped with the release. These KPIs will surface on the different role centers.

Enabling the usage of the new Power view technology (You can learn more about this from the Murray Fife's post Creating PowerView Dashboards Against Dynamics AX 2012) introduced in Microsoft SQL Server 2012. This will help users to discover new insights through a highly interactive and familiar data visualization technology.

Increase Global Reach and Simplify International Operations

AX 2012 R2 has increased the global reach of Microsoft Dynamics AX 2012 by adding localization for 11 new markets (Brazil, Czech Republic, China, Estonia, Hungary, India, Japan, Latvia, Lithuania, Poland, and Russia), extending the reach for Microsoft Dynamics AX 2012 to support 36 localizations worldwide.


Simplify the Application Lifecycle for Customers

This goes from simplifying single instance international ERP deployment scenarios up to simplifying setup and functional implementation with new and improved lifecycle services.

Also, in AX 2012R2, we’ll see:

  • The Code Analyzer that will help us analyze the performance of custom code based on rules in the design phase of an extension by customers or partners.
  • The Data Migration Framework will support import, export and migration of data to/from Microsoft Dynamics AX 2012 in the deployment phase. It will cover over 20 scenarios including customer, vendor, product, employee, BOM, open sales and purchase order data, which can be extended by partners and customers.
  • The Diagnostics Framework will assist by analyzing data collected from the installation’s servers based on rules in the maintenance phase.

It is really exciting to see all these improvements in new release, as it will add more value to customer acros the board and it will help AX 2012 R2 to be used in other countries based on the localization improvements.

Take care and until the next post!



Thursday, January 3, 2013

Create Product / Product Masters AX 2012

 

Hi There,

I hope everyone had a great new year and that you are ready for a new one full of challenges, and good things.
 
In this post I would like to discuss how to create product and product masters in AX 2012. Sometimes our requirements vary depending on the customer, and more often than not, we need to provide a dynamic option to create either a product or a product master.

So, what is the definition of these two terms?

Product: This is the simpler of the two. They do not need product dimension groups when created.

Product Master: This type must contain product dimension groups; otherwise you’ll get a run-time error at the time the EcoResService is called.

The product dimension groups can be Color, Size, Style and Configuration. In addition, you can create any other dimension group. In my example, a user created a dimension group called “Revision”, which is the chosen one for this example. This shows how flexible AX2012 is around product dimensions.

The following code takes two parameters. One is the product name (which has a custom EDT), and the product sub type (is it product or product master). Further, to achieve this we will use the following classes:

EcoResEcoResProduct_TrackingDimGroup   
EcoResEcoResProduct_Product_Master     
EcoResEcoResProduct_Product_Distinct   
EcoResEcoResProduct_ProductDimGroup    
EcoResEcoResProduct_StorageDimGroup    
EcoResEcoResProduct_translation        
EcoResEcoResProduct_Identifier         
EcoResProductService        

           
The EcoResEcoResProduct_Product_Master (http://msdn.microsoft.com/en-us/library/ecoresecoresproduct_product_master.aspx) class is in charge of creating the new Product Master, and the EcoResEcoResProduct_Product_Distinct (http://msdn.microsoft.com/en-us/library/ecoresecoresproduct_product_distinct.aspx) class is in charge of creating the Product. These records are going to be created in the EcoResProduct Table.
 
As you probably know by now, even these records exist in the EcoResProduct table, they haven’t been release to AX just yet.

Moving right along, we will be using the EcoResProductService class (http://msdn.microsoft.com/en-us/library/ecoresproductservice.aspx) to actually create the product in the EcoResProduct Table.

/// <summary>
/// Creates a new product in EcoResProduct
/// </summary>
/// <returns>
///
/// </returns>
/// <remarks>
///
/// </remarks>
/// <exception cref="Exception::Error">
/// Throws error upon Exception.
/// </exception>

 
public static void CreateEcoResProduct(ProductName _ecmProductName, EcoResProductSubtype prodSubType)
{
    EcoResEcoResProduct_TrackingDimGroup    tracDimGroup;
    EcoResEcoResProduct_Product_Master      productMaster;
    EcoResEcoResProduct_Product_Distinct    distMaster;
    EcoResEcoResProduct_ProductDimGroup      prodDimGroup;
    EcoResEcoResProduct_StorageDimGroup      storDimGroup;
    EcoResEcoResProduct_translation          translation;
    EcoResEcoResProduct_Identifier           identifier;
    EcoResProductService                     ecoProdSvc;
    EcoResProductNumber                      lEcoResProductNumber;
    NumberSequenceTable                      numberSequenceTable;
    EcoResEcoResProduct                      ecoResProd;
    EcoResProductType                        ecoResProductType;
    boolean                                  isMaster = false;
    ;

 
    try
    {
        // create product by initializing the Service object
        ecoProdSvc = EcoResProductService::construct();

 
        // initialize the EcoResEcoResProduct object
        ecoResProd = new EcoResEcoResProduct();

     
        numberSequenceTable = EcoResProductParameters::numRefProductNumber().numberSequenceTable();


        lEcoResProductNumber = NumberSeq::newGetNumFromId(numberSequenceTable.RecId).num();
        ecoResProductType = EcoResProductType::Item;
      
        if(prodSubType == EcoResProductSubtype::ProductMaster)
        {
            isMaster = true;


            //Create a new product master
            productMaster = new EcoResEcoResProduct_Product_Master();

 
            //initialize product master
            productMaster.parmDisplayProductNumber(lEcoResProductNumber);
            productMaster.parmProductType(ecoResProductType);
            productMaster.parmSearchName(_ecmProductName);
           
            productMaster.parmVariantConfigurationTechnology(EcoResVariantConfigurationTechnologyType::PredefinedVariants);

 
            //create a product master Translation Object
            translation = productMaster.createTranslation().addNew();

 
            // create a new identifier object
            Identifier = productMaster.createIdentifier().AddNew();

 
            // Create the ProductDimensionGroup
            prodDimGroup = productMaster.createProductDimGroup().addNew();
            prodDimGroup.parmProduct(lEcoResProductNumber);
           
            prodDimGroup.parmProductDimensionGroup('Revision');

 
            // Create the StorageDimgroup object
            storDimGroup = productMaster.createStorageDimGroup().addNew();
            storDimGroup.parmProduct(lEcoResProductNumber);
            storDimGroup.parmStorageDimensionGroup("S-W-L");

 
            // Create the TrackingDimGroup object
            tracDimGroup = productMaster.createTrackingDimGroup().addNew();
            tracDimGroup.parmProduct(lEcoResProductNumber);
            tracDimGroup.parmTrackingDimensionGroup("none");

        }
        else
        {
            // Create a new product distinct master
            distMaster = new EcoResEcoResProduct_Product_Distinct();

 
            // Take the newly created and initialize ProdMaster - variable and fill with product data
            distMaster.parmDisplayProductNumber(lEcoResProductNumber);
            distMaster.parmProductType(ecoResProductType);
            distMaster.parmSearchName(_ecmProductName);

 
            // Create a translation object
            translation = distMaster.createTranslation().addNew();

 
            // Create a new identifier object
            Identifier = distMaster.createIdentifier().addNew();

 
            // Create the StorageDimgroup object
            storDimGroup = distMaster.createStorageDimGroup().addNew();
            storDimGroup.parmProduct(lEcoResProductNumber);
            storDimGroup.parmStorageDimensionGroup("S-W-L");

 
            // Create the TrackingDimGroup object
            tracDimGroup = distMaster.createTrackingDimGroup().addNew();
            tracDimGroup.parmProduct(lEcoResProductNumber);
            tracDimGroup.parmTrackingDimensionGroup("None");
        }


        // fill the translation object
        translation.parmDescription(_ecmProductName);
        translation.parmLanguageId('en-us');

 
        //translati
        translation.parmName(_ecmProductName);

 
        // fill the identifier
        identifier.parmProductNumber(lEcoResProductNumber);

 
        // add the product to ecoResProd
        if(isMaster)
            ecoResProd.createProduct().add(productMaster);
        else
            ecoResProd.createProduct().add(distMaster);

 
        // create the product using service
        ecoProdSvc.create(ecoResProd);

    }
    catch(Exception::Error)
    {
        throw Exception::Error;
    }
    catch(Exception::Deadlock)
    {
        retry;
    }
    catch(Exception::UpdateConflict)
    {
        if(appl.ttsLevel() == 0)
        {
            if(xSession::currentRetryCount() >= 4)
            {
                throw Exception::UpdateConflictNotRecovered;
            }
            else
            {
                retry;
            }
        }
        else
        {
            throw Exception::UpdateConflict;
        }
    }
}




Happy New Year and until the next time!




Friday, September 14, 2012

Delete User Layer with AX 2012 Management Shell

 

Hi there,

I hope you are ready for a great weekend. I will have to work, but this is why we love what we do, and believe that our customers should get the best of us.

Anyway, this is going to be a short post about how to delete a user layer from the model store in AX 2012. I have to say that I miss the flexibility of AX 2009 when it comes to application files and layers. The good news is that for the Microsoft Dynamics AX R2 release, we are supposed to have the code in a different database.

Ok, so going back to our topic, to delete a user layer from the model you first need to install the Management Tools from your AX 2012 setup. Once this is done, you can access the Microsoft Dynamics AX Management Shell and write the following script:

axutil delete /layer:Usr

See the picture below for more details:

 

As you can see, deleting a layer is not difficult at all and it happens fairly quick too. Also, it is very important that you have a backup of the database before performing this action.

That's all for now folks.




Monday, September 10, 2012

Creating a Retail Store in AX 2012 Retail

 

Hi there,

I hope everyone is ready for a new AX filled week, and that you had a good weekend. This week I have a lot of work ahead of me, but I wanted to take the time and share with you the steps necessary to create a retail store in AX 2012 Retail.

The creation of a retail store requires many steps and some planning. I would like to extend my gratitude to Liam Breslin for his knowledge on this topic. He is a Senior Consultant for Junction Solutions and he specializes in Retail. You can contact him on his LinkedIn profile for any questions you might have about AX 2012 Retail.


So, let’s go to the good stuff now and let’s create retail store in Microsoft Dynamics AX 2012

1- Go to Retail > Common > Organization

2- Click the Organization Hierarchy tab button to create a new organization hierarchy.


3- When the new window opens, click New and assign a name to the new organization hierarchy (i.e. Retail Store).

 




4- Then click the Assign Purpose button to open the Organization hierarchy purposes window. In here we need to link the Organization Hierarchy you just created in step 3 with the organizational chart portion of AX.  To accomplish this, click the Add button to add a new Assigned Category. Once you have created the assigned category, click the Set as Default button. This will set your configuration as the default one to carry on later on the process.



 

5- When step 4 has been completed, click the Retail Assortment menu on the left and follow the same process you executed in step 4.


 



6- When finished you should see the following





7- Then go to Organization Hierarchy and click the Organization Hierarchy view. When the Hierarchy Designer opens, click the Edit button.




 

8- Click the Insert button and choose Legal Entity





9- The legal Entity (i.e. CEU) will appear in the Retail Store designer.



10- Click as Save as Draft. On the Save Changes windows choose “Save as draft” and click OK.


 


11- Then you to Retail > Common > Retail Channels > Retail Stores

 

12- Click New Retail Store and fill the required fields.


 

13- Go to the miscellaneous fast tab and make sure you have your payment methods. On this, for some reason in my environment, the Credit Card Payment method needed to be setup to 2 and not 02.



14- If all goes OK, you should see the following.

 

15- Now, go back to Hierarchies to add your new Retail Store to it under your organization. For this, click the Edit button and choose “Keep working on this draft” and click OK.

 

16- Click the Insert button and choose Retail Channel.

 

17- From the Retail Channel window choose your new retail store, and click OK.



18- If all is ok, you should see something similar to the picture below.

 

19- Save your new model as draft again.

 

20- In order to make the model “official” within AX, we need to publish it. Do this by clicking Publish and Close the Viewer.

 

21- Select the effective date when you want this model to be active and click the Publish button.

 

22- You should see the following message.

 

Once you have created your retail store(s), then you can create assortments and assign them to products and/or product groups to be publish into the retail channels. The assortment(s) will then be transferred to the AXRetailPOS database through an N-JOB.

I will cover this portion in one of my next post.

Until then!

 

Thursday, September 6, 2012

Zip Codes Upload in AX 2012

 

Hi there,

Today I would like to discuss how to load Zip Codes to AX 2012 from a Text file and also point out what happens in the background.



In AX 2012, this task is fairly simple as there is an abstract class (AdressZipCodeImport) that takes care of this function. In addition to the abstract class, there is another class (AdressZipCodeImport_US) for each specific country that overwrites the ReadFile() method in the AddressZipCodeImport abstract class. In AX 2012, there only 4 countries available for Zip Code upload.

AddressZipCodeImport Class:

 
 


AddressZipCodeImport_US Class:




The AdressZipCodeImport_US class ReadFile() method contains a while loop that will allocate the data from the file being read  into the LogisticsAddress variables. To accomplish this, you will have to have your zip code, city, state and county name in an Excel file where you create the required spaces between fields and then save it as space delimiter file.

ReadFile() Method:




The following is an example of this sequence:


 

The following is the ReadFile() sub string coordinates:

 

When your file is ready, you can upload it by going to Organization Administration > Setup > Addresses > Import Zip/Postal codes:


Once you run this, the data will be in the LogisticsAddressZipCode table

 

It is very interesting to see how the AX 2012 team has put a lot of thought into these common tasks as they help us be more efficient on something we don't need to really spend a lot of time figuring out.

Until the next time!



Friday, August 17, 2012

Working with the AX 2012 EDT relation migration tool



Hi there!

This week I was faced with a couple of problems related to the relationships between tables made under an Extended Data Type (EDT). In my case, I learned that when relationships between tables exist through EDTs, they only capture a single field relationship and not necessarily a “real” relationship between tables.

A good example of this is when we assign an ItemId EDT to a custom field in a custom table. In this case, AX 2012 will ask you to create an EDT relationship, so I did. Later on the week, I was getting an error related to a violation of a primary key in the custom table I created when data was being inserted to it.

The error was related to the relationships being defined under an EDT as the kernel was have issues defining which relationship to examine first.

It took me a while to understand that the problem was the EDT relationship and after looking at some documentation it was easy to catch the issue as EDT relationships do not contain relationship metadata, such as cardinality and relationship type, and more often than not, they cannot be included in the relations node.

Luckily for us, AX 2012 provides a simple way to fix the EDT relations issues fairly easy. In fact, the migration can be done both manually or using the new EDT relation migration tool. However, if the data model is not correct, there are cases where we are going to have to fix the EDT’s manually.

To begin using the EDT relation migration tool, open the form for the tool by using the navigation path Tools > Code upgrade > EDT relation migration tool as seen in the picture below.



NOTE: Just keep in mind that if you are using this tool for the first time, AX 2012 will ask you if you want to refresh all the EDT relationships data, click yes and the EDT Migration tool will open.


When the form has opened, follow the next steps:
  1. Select a table from the Table name pane.
  2. Select each relation in the EDT relations table and choose an action from the Migration action drop-down menu for each of them.
  3. After you have set an action on all the relations for that table, click the Migrate single table button on the ribbon at the top of the form.

See Image for clarification:



What happens in the background?

  1. The migration tool attempts to find a match for the EDT relation in the existing relations in the selected table. If a match is found, the SourceEDT property on the table relation is set to the name of the EDT.
  2. However, if there is no match found in the table, the EDT migration tool will create a new table relationship only if the index (IndexType ) on the referenced table (shown by “”) is set to the correct table relationship.
  3. Finally, the tool will not create a new table relation if the matching index for the EDT field on the referenced table is set to NoIndex, Unique, NonUnique.

Example: Migrating an EDT relation to a new table relation.

This example shows the case in which an EDT relation is migrated to a table where the table relation was previously not defined. The result from this example will be the creation of a new table relation.

The EDT PKTableField1 defines a relation to the PKTable.Field1 field, which is an alternate key AK1.


In addition, before the EDT migration, the FKTable.Field1 field uses the EDT PKTableField1, which makes it a foreign key into PKTable. However, there is no table relation defined on the FKTable, and the ExtendedDataType property on FKTable.Field1 is set to PKTableField1 instead.



We choose the FKTablle and under the Migration Action, we choose Migrate.



What happens in the background?

The EDT relation migration tool performs the following actions:
  • The EDT migration tool creates the new relation to the PKTable under the Relations node of the FKTable. This relation will be of type Normal because the key is not the primary key.
  • Then, the EDT migration tool will set the EDTRelation property of the PKTable relation to Yes. This is because the tool performs the direct migration of an EDT relation to the table relation.
  • Then, the EDT migration tool creates one field link, FKTable.Field1 == PKTable.Field1, for the PKTable relation.
  • Finally, the EDT migration tool will set the SourceEDT property of the field link to PKTableField1.

What to expect the next time we use the tables?
  • All the APIs that used the EDT relation first on FKTable.Field1 will now find the same relation with the same field link under the PKTable relation by examining its SourceEDT property.
  • If a table relation that refers to PKTable already exists in FKTable, all the APIs that used those table relations will not pick up the PKTable relation because it is flagged as an EDTRelation, and the PKTable relation to the Relations node of the FKTable, with its EDTRelation property set to Yes.



In addition to the above, we can also double check the outcome of the EDT migration tool by looking at the SourceEDT property of FKTable.Field1. This should have been set to PKTableField1 to maintain a relationship with the EDT.



Let recap for a minute on what we just went over. The EDT relation migration tool can be used to automate the following actions:

  • Copy an EDT relation to all hosting tables.
  • Automatically set the EDT migration properties (markers) to reflect migration status.
  • Automatically populate relation metadata.
  • Derive cardinality from the index on the foreign key.
  • Derive the relationship type from the delete action/key composition.
  • Determine role names.
  • Report AOT objects impacted by the migration, depending on the relation used. The objects that can be affected include:
    • Queries:
    • Forms
    • Delete actions on tables
    • Data sets
    • X++ reports
Well folks, I think this is it for now. I really hope you like this article and that can help you at some point in your AX 2012 adventure. Also, I will be writing a bit more about AX 2012 Retail and Inventory and Product management in AX 2012 soon, so don’t miss it!



Have a great and restful weekend!




Friday, May 25, 2012

AX 2012 Retail Event Trace Parser - Missing?



Hi there,

I hope everybody had a great week and that you are ready for a well-deserved long and restful weekend.

As you already know, I will be working on a series of articles related to the Microsoft Dynamics AX 2012 POS application. Last week I wrote an article called
AX 2012 POS Development - Application Triggers. Please check it out if you haven’t already done so.

In the course of this week I have been gathering a lot of information about the AX 2012 POS application, and the more I work with it, the more sense it makes to me. There are many different layers to this application, but this will be covered in future articles.

Anyway, this week I was working on a new instance of the AX 2012 POS application. To run it from Visual Studio, I followed the steps outlined in my last article AX 2012 POS Development - Application Triggers.

When all the setup steps were completed, I started the solution, keyed my user name and password and all of the sudden I got the following error:



This was odd as I went back to the demo instance I have and after following the same steps, I did not get this error. Luckily, there is LOG table called RETAILLOG in the AX 2012 POS application that can tell you what’s going on, and for my surprise, I was missing the Microsoft.Dynamics.Retail.EventTraceParser.dll as depicted in the following picture (from a working application).




The solution was easy; I just placed the missing dll to my AX 2012 POS application root folder. So, the Event Trace Parser enables rapid analysis of traces to find the longest running code, longest running SQL query, highest call count and other metrics useful in debugging a performance problem.

The Microsoft.Dynamics.Retail.EventTraceParser.dll is installed when installing AX 2012 for Retail and you can find it in your AX 2012 client folder.

The Walk through major features of Microsoft Dynamics AX 2012 article will give you a good introduction to its basic concepts.

That’s it for now folks. I hope you have a wonderful weekend. And stay tune for more to come on AX 2012 POS development. Next week I will post about how to use the AX 2012 POS System.Settings dynamics library and its in-memory functions.

Also, the following week I will write about Blank Operations by going through a really cool simple project.
Take Care!