Thursday, February 24, 2011

Only able to select companies in the domain

Here is a security tip I learned from a previous project. After company domains are all properly configured, it's natural you want users only to be able to select companies that they belong to. If you grant access to Admin - Open domain access, it'll open up all companies in AX for the user to select, although he can't do or see anything in the companies that he doesn't belong to. What's even annoying is he can't click company link and go to the other companies and gets stuck in the wrong company unless restarts AX.

A very simple workaround. Create a separate user group for each domain for company selection. In this group, DON'T give access to "Open domain access", but give access to Admin - Tables - Company data. Remove company access from all the other user groups and add this special group to the group collection. Here you go. Only able to see companies in the domain.

Wednesday, February 23, 2011

Out-of-the-box connector between Dynamics CRM and AX

Today, Microsoft announced it's building an out-of-the-box connector between CRM and AX and data migration assistant for moving from Oracle db to SQL. New Microsoft Dynamics ERP Resources Save Customers Time and Money
Microsoft Corp. (Nasdaq “MSFT”) today announced new resources to help improve productivity and save Microsoft Dynamics enterprise resource planning (ERP) customers time and money through new interoperable Microsoft technologies. The new resources include an out-of-the-box connector between Microsoft Dynamics CRM and Microsoft Dynamics AX and a Data Migration Assistant for Microsoft Dynamics AX customers moving from an Oracle database to Microsoft SQL Server.
The connector is available between either Dynamics CRM online or on-premise and Dynamics AX. Having been able to work with both Dynamics CRM and AX, I think this is a great move by Microsoft. From time to time, customers ask me what's the difference between Dynamics CRM and CRM in AX, or why Dynamics CRM can't talk to AX easily - they're both Microsoft product right? My response normally would be "uhh..." I don't want to tell customer that the foundation of current AX isn't truly Microsoft-based which makes integration harder. With no doubt, there are tremendous demands on combining the full ERP spectrum of AX with the great mobility/flexibility of CRM and working seamlessly together. It looks like the time has come now. Let's see when the tool will be ready for the community to play.

Tuesday, February 15, 2011

Over-a-year workflow issue finally gets closed!!

It's a big day in the history of my AX life. After over-a-year battle with Microsoft on a workflow issue, today we've officially got the issue closed!!! I'm not sure if this is the longest-open case in Microsoft AX history so far, but I've almost got thrown up on this marathon.
The client has AX 2009 SP1 on two AOSs. Business connector, IIS and AX settings were all configured. However, the following error got thrown randomly every other days and got completed workflow strandered. "Stopped (error): Failed to find workflow instance. Failed to find workflow instance."


There are several unique issues that make this workflow problem hard to solve:
  • Error throws after workflow is completed.
  • It seems errors randomly occurred. When there are a large number of workflows (> 50) being processed, errors are likely to be thrown.
  • Hard to repro the error or test solutions. We had to accumulate enough workflows in the queue in order to trigger the error. It was a real pain by doing this all manually. Later, we wrote a script to simulate the submission process and it's much better.
  • We have custom workflow templates.
The hotfix number is 2398999 in case you're seeing this error and don't want to spend another year on finding the solution :)

Tuesday, February 8, 2011

Production variance reval by inv close

In AX 2009, as a new feature, at the last step of an inventory close after settlement, it'll revalue production variances for ended work orders. This is the method that does the actual job: Class InventCostHelp > updateLedgerPosting, and I stripped the method comments:

Controls the last stage of the inventory closing.
In this stage the following things will be done:
- Production variances for ended production orders
- Indirect cost for open production orders
- ledger postings
- Creation of the inventCostTransSum records
- Final check against the prodTable


If you want to analyze the variances from the closing voucher, e.g. which prod orders generated the variances, you'll have to dig into the InventCostTrans and InventCostTransVariance tables, or check the IM>Inquiries>Standard cost transactions form.
A comprehensive digest of inv close in AX can be found at Denis Fedotenko's blog on Costing and Inv Closing

Monday, February 7, 2011

Update item cost price to on-hand cost in AX 2009

A common request from the client is to update their item costs under costing version (Item master > Price button) to the latest on-hand cost. I think it’s common because on-hand cost could change quite a bit from the original go-live cost price as time goes by, and this is especially true for weighted average items. As many of you know, the cost price from costing version is used in many places for calc invent cost, e.g. counting/PL journal, std cost rollup, etc. Though inven adjustment and close could rectify this problem (to some extent), you’ll have to live with the incorrect financial reports throughout the time and remember to adjust the cost again on next inv close. There is a checkbox on the item master – “Latest cost price” which saves the latest cost price to the costing version. However, I found it doesn’t work properly in a multi site environment. VersionID is always empty.
I couldn’t find an out-of-the-box function in AX to address this issue, so decided to do customization. On the costing version form, I added a button “update cost to on-hand cost”. On the new form, you can select which items you want to update, and then click ok. That’s it. Here are some highlights:
  • To update item cost price (Items > Price button > Costing versions) to its on-hand average cost.
  • Added a field CopiedFromOnHand to the CostingVersion table, so those pending costs added by this script can be easily identified when to be activated
  • Assume each operational site only has one main warehouse
  • Only the item that has physical inventory for the warehouse gets updated.
SharedProject_UpdateCostPriceToOnHand.xpo