Dynamics AX - Retail Scheduler Gotcha

On a recent project, I ran into a bit of a "gotcha" today around data replication to the Retail POS in Dynamics Ax 2012 R2.  We had created our own schema in order to transfer customized table data to the POS, however, the data would never be written, no matter what we tried.  Before I get to the solution, fist some background on the new Retail Channel Schema in R2.

In R2, Microsoft has moved away from a single schema mentality when synchronizing data to the POS.  It is now utilizing a more flexible multi-schema model.  One of the advantages of this model is to allow AX 2012 R2 to seamlessly communicate with both old and new POS versions without issue.  It does this by defining a schema for each version of the POS.  Out of the box, it looks something like this:


Notice there are schemas defined for most version of Dynamics AX (this model doesn't support the POS pre-2009).  This will allow the Retail Scheduler to synchronize data between AX 2012 R2 and AX 2009 POS for example.  The possibilities for using this framework to synchronize data between AX and 3rd party databases are there as well, but that is an entirely different blog post.

As a best practice, it is generally a good idea to take a copy of existing functionality before modifying it for your particular customization, so I do that here.  Through simple X++ scripts, I copied the RetailConnChannelSchema, RetailConnLocationDesignTable, and RetailConnLocationDesignTableField to a new Schema, called "My Schema".  This can also be done by using the UI to create a new schema and using the Read Schema function, pointing to a non-customized "vanilla" store database.


Once a new schema is in place, in order to utilize it, you must set the Distribution location(s) to point to the new schema, as seen below:


We must also update the subjob(s) that rely on the new schema to the new schema.


Now, here is where our "gotcha" rears it's ugly head.  With this configuration alone, if we run the Job that contains this subjob (in this example, N-1000), AX will appear to have run the scheduler without issue, however no information is sent to either the Head office / Message databases, or the store database itself.



After several hours of head scratching, and some code walking, it turns out that if the Distribution Location schema is not the same as the Job schema, the job is completely skipped for that distribution location.  That is to say that in our current example, even though the schema definition is the exact same (only the name changed), AX still treats it as an entirely different schema and skips the job.

Of course, the solution is simple, setting the Job Schema to "My Schema" resolved the issue, and data flowed freely once again.




Comments

Post a Comment

Popular posts from this blog

SQL Reporting Services - Viewer broken in Non-IE Browsers: FIX

Dynamics AX 2012 - Visual Studio Team Services Custom Work Item Fields Break Version Control (Error TF237121)

Dynamics AX SysFileDeployment Framework - Deploy files automatically (using resources) to the client on login