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'

No comments:

Post a Comment