AX 2012, the Wizard Wizard, and Origin GUIDs

I had a weird issue in AX recently, and, since I didn’t find much mention of it on the web, I thought I’d write it up for my blog.

A while back, I had used the “Wizard Wizard” to create a wizard form in AX. The name of this tool is kind of silly, but it’s basically correct — it’s a wizard that helps you create the form and class objects necessary to create a standard wizard control in AX. It worked fine, and the resulting wizard was deployed to production a few months ago.

I needed to make a change to it recently, though, and when I tried to import it to our testing environment, I got the following error: “Unable to save Form MyWizard. Origin value: {GUID value here} conflicts with element from model store.”

This led me down quite a path, as I haven’t really ever had a reason to dig into origin GUIDs before.
There’s a little bit of history on the origin GUID here and the best explanation I could find on origin GUIDs is here.

So, once I knew a bit about origin GUIDs, I did a little digging, and discovered that the origin GUID for my form was different in each of our environments (dev/TFS, staging, and prod). This should never happen; as the article above states, “this origin will be the same for this element in all installations, environments, versions and variations.” So… huh. How did that happen?

I looked into the TFS history, and discovered that the initial check-in for the form had no origin GUID at all. That line was simply missing from the XPO. So, if I understand things correctly, the lack of an origin GUID field in TFS is likely what caused it to be assigned new and different GUIDs in staging and production. (And, at some point, the field got filled in on my VM and made it into TFS with a completely different GUID.)

I looked into a number of other forms I’d created in the past, and couldn’t find a single instance of this ever happening before. I quickly realized that the one thing that was different about this particular form was that it had been created with the Wizard Wizard. I couldn’t initially find any evidence of an issue with this wizard, but eventually I found this question on Stack Overflow, from someone else who seems to have had the same issue.

So the end result is that I now know that, if I’m going to use the Wizard Wizard, I need to make sure I do something to force the generation of an origin GUID before I check anything in to TFS. (And that Stack Overflow question indicates that the “best practices” checker would likely have flagged this, so I should probably use that more often.)

I couldn’t come up with a particularly good solution to clean up this issue, other than duplicating the form to a new object, and deleting the old form. I briefly considered taking the GUID from prod, and trying to shoehorn it into the other environments, but that seemed like a bad idea, since I’d need to mess with TFS and with the ModelElement table in the database in each environment.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.