Sunday, October 27, 2013

AX for Retail: AX code changes not being reflected in POS operations

Issue: When making customizations to the AX for Retail POS class in AX 2102 [Classes\RetailTransactionService] (also known as the AX RTS class), the changes are not being reflected in the operations coming from the POS.

Example of issue: The AX RTS class is modified show additional information in the POS which is time sensitive data and must be retrieved from the headquarters at the time of inquiry (when RTS should be used). The changes are made but the POS is operating like the old code was, not the new code.

Solution: The Retail Transaction Services service (or Commerce Data Exchange in 2012 R2+), which the POS is using to talk to AX, must be restarted for the new code to be seen in the POS. The POS will only use the code as it existed in this class the last time the service was restarted.

Reason: Not entirely sure why this is the case but it appears the code is cached somewhere for the POS instances to use. It doesn't use the code in AX as it changes. I can speculate on why it was designed that way (e.g. performance) but other than that, I'm not 100% sure why it operates that way.

It is pretty common to have the AX developer say an issue is fixed (when in this code) and then have the POS tester see no changes to the code if the RTS service is not restarted. It can create some friction or headaches if you don't know why that is the case. Odds are the AX dev is testing from within AX using a job at which point the RTS component is not utilized so you will get inconsistent results. Once you get into the groove of things, its just one of those things you need to remember to do.

Hope the above helps!

Monday, October 21, 2013

Free shipping promotions - One of the most effective promotional tools

The whole purpose of promotions is to ultimately do one thing: spur sales. Promotions can range from super simple to extremely complex with offering free item(s), dollars/percentages off, etc. Whether the promotion is supposed to sell a certain type(s) of item(s), raise the amount of the average order, or spur sales at a specific time, each type of promotion can help to achieve whatever end goal retailers are attempting achieve.

To note, there is one type of promotion that can be adapted to almost any promotion strategy whether it is on its own or supplementary to another sale: Free Shipping. It does not just have to apply to online sales as some big ticket retailers will also offer this promotion for customers purchasing within their physical stores.

It's one of my favorite promotions, and according to research I found online, it is for a majority of the population as well. While I normally don't trust 'studies' from online and other companies without more intimate knowledge, I believe this one because it resonates with my shopping habits and sales trends I have witnessed in my professional career. Everyone loves free shipping.

Here is a stat from Stamps.com I found online that helps provide additional validation:
"According to 64% of the respondents, free shipping—with or without minimum spend—is the most effective promotion an e-commerce merchant can offer to drive sales during the holiday season.  Coming in second place was another shipping-related promotion. 26% of the respondents chose discounted shipping as an effective tool to drive sales.  Note:  survey respondents were allowed to choose multiple answers." http://blog.stamps.com/2010/11/10/ecommerce-holiday-shipping-survey/

Below are four personal instances of when free shipping has worked for me in different promotion types:
  • Free shipping for reaching a sales total dollar (or percentage) amount
    • I have spent $100 on stuff instead of only $50 just because I can get free shipping. 
  • Buy a certain item, get free shipping
    • I was buying something online last week and also ended up buying an additional item I liked but didn't really need because buying the item gave me free shipping. 
  • Free shipping for members of a service
    • When I'm looking to purchase items, I also look on Amazon and attempt to get free shipping on 'Prime items' because I pay for a yearly membership to the Amazon Prime service. Plus its two day shipping!
  • Free shipping during a certain time
    • On 'Black Monday' sales, a lot of online retailers will offer free shipping without any strings attached. I don't have to leave my home to take advantage of Black Friday like sales.
So why is it that its so effective? At a philosophical level, people seem to shop based on the saving money, whether it is actually saving money or merely the illusion of doing so. Technically you are saving money by buying $50 worth of product and $10 of shipping ($60 total) instead of purchasing $100+ worth of product and $0 of shipping. Then again, if you buy everything you need to buy in one sales order, you may not have to pay for that $10 shipping charge for two orders (which is technically saving you 20% on items that aren't on sale). Then again, would you actually purchase the items on that second order if you didn't talk yourself into taking advantage of the free shipping?

When you ask someone what are some of the cons of ordering online (or a large item that can't be carried out of the store by the customer), one of the main points will probably be paying for shipping. When you eliminate shipping as one of the cons, it makes the purchasing experience seem so much more attractive as it allows you to to buy the products from a group of companies at low, competitive prices that can be lower than some of the prices you find in a physical store. Plus it saves you time from going out and searching for the items of interest in stores which may or may not have the items in stock and maybe at a higher cost. Additionally, when purchasing from within a store with free shipping, it lets you realize how much time and effort you are saving by not lugging a large item around on your own. Team lifts are really bad single lifts...


Hope that the above provides some additional insight into the awesome 'free shipping' promotion.

Friday, October 11, 2013

What is database normalization? Good/bad? Yes...

There are a lot of people who talk about how important database normalization is for primary functionality tables and make it a talking point when evaluating the technical sides of an ERP. That is all well and good but I think the actual question should be around the developers of the solution and if they took normalization into account with the solution. If a table or set of functionality is normalized, it doesn't really tell me anything either good or bad. It only throws a red flag and a bunch of questions before determining anything else.

Hopefully this will show up on the first page of Bing/Google when someone types in something to the tune of 'AX 2012 database normalization'. <- 'Gratuitous line for search engines'

What is database normalization?

Database normalization (n) definition - (WIKIPEDIA) - Database normalization is the process of organizing the fields and tables of a relational database to minimize redundancy and dependency. Normalization usually involves dividing large tables into smaller (and less redundant) tables and defining relationships between them. The objective is to isolate data so that additions, deletions, and modifications of a field can be made in just one table and then propagated through the rest of the database using the defined relationships. http://en.wikipedia.org/wiki/Database_normalization 

Sounds awesome right? Can be, not always. There are pros and cons to it. Sometimes a denormalization structure is best. I don't think anyone will agree that normalization is the answer 100%. While there are more points to the below, I'll only cover a few basic ones.

Normalization
Pros:
  • Updating tables can be faster (fewer fields)
  • Can be less risk of database locking
  • More flexibility to expand functionality of solution
  • Removes or reduces redundancy
  • Increase data retrieval times for single tasks (if designed correctly)
  • Enforce relationships between data in joined tables (referential integrity)
  • Can split up a table with many fields that will be quite large into multiple database servers
Cons:
  • Indexing strategies not as effective as data is spread out across multiple tables
  • If a developer doesn't know what they are doing (or requirements are incorrectly identified), it can create a mess very quickly
Denormalization
Pros:
  • don't have to worry about joins in a denormalized structure. 
  • reporting and integration can be an easier task than white boarding out a network of tables.
  • Indexing can be more effective
  • Easier to maintain and understand schema
  • Good approach to consider when CPU is an issue
 Cons:
  • Updating tables might be slower
  • Updating development on one large table with many fields
  • Retrieving records may be slower
Basically, the big take away is that this conversation is very situational. Different scenarios make situations unique.  It's like asking a financial adviser how much the person is supposed to sock away for retirement by age XX. Having 50k saved and 10k in credit card debt is worse than 40k saved and 0k in credit card debt. Many pieces in the equation to consider.

The ultimate answer is to know both normalized and denormalized DB strategies. Through thorough planning of a solution, you can determine the best approach. As for asking about database normalization, I think the best initial questions to ask up front are:
    a) are the developers of the solution competent
    b) did they take normalization into account when designing the solution

For more information, I strongly encourage you to do some more research into these concepts. It can only help!



http://www.ehow.com/info_8072774_advantages-disadvantages-normalizing-database.html 
http://www.alc.amadeus.com/content/public/alw/skillsoft/cbtlib/108595/110939/eng/wpaper/nito.html
http://misclassblog.com/database-design-and-development/normalization-vs-denormalization-2/
http://databases.about.com/od/specificproducts/a/normalization.htm
http://www.youtube.com/channel/HC7l34gDhqk5k
http://webandphp.com/DataModeling104%3ADenormalization

Friday, October 4, 2013

AX 2012 for Retail R2 - error 'The order could not be saved at this time' is being thrown but POS was previously working.


In AX 2012 for Retail R2, you can occasionally see the error 'The order could not be saved at this time' (Figure 1 below).  

Not very descriptive I know. This usually occurs when attempting to save an order (sales or quotes) in the system via a Retail Transaction Services (RTS) call. In case you are unaware, the RTS class in AX is the collection of methods used in the POS to get 'real time' information that is not stored within the POS. 

In addition to the error below, I was also noticing other 'weird' occurrences like lists in a POS form not returning data to the user and forms just not showing up. Very odd and definitely gave off the vibe that something was wrong.

Usually, the error is caused in the functionality of one of two things:
  • issue with the AX Commerce Data Exchange: Real-time Service (CDE:RTS) or Retail Transaction Service (RTS) in non-R2 versions
  • the code in AX attempting to create/update the order. 
As long as the AX and POS code is working correctly and it just started happening, a start or restart of that service might be able to take care of things. I'm not entirely sure of why this occurs and what is fixed by it (but I have a lot of ideas) but it does seem to fix things.

I was seeing this error occur even after the service was restarted and all of the functionality was working previous to this error popping up.  The next step I took was verifying that the call was even making it to AX. Sure enough, it was not but it used to...

Solution: This was actually an issue with the servers memory being totally consumed. The RAM was at 97%. It was a single tier box for AX 2012, the DB, the POS, and acting as a single-tier Sharepoint 2013 topology. Quite a bit going on. And in an earlier release of the VM, there was a rogue IIS Worker Process that was consuming all the memory so I had to keep killing it. 

Needless to say, as soon as I killed that rogue IIS Worker Process, the memory went back down to 82% and everything was working as normal. To clarify though, this memory issue would exist on the server where the CDE:RTS for that store operates.
Figure 1 - The error 'The order could not be saved at this time'