Monday, November 30, 2015

Dynamics AX 7 expected to be released in Q1 2016

Microsoft has announced that the next version of the AX 7, which is completely hosted as a web application is proposed to be released in first quarter of 2016. The best news yet that has been from the Dynamics AX release team is it would be available for public preview exclusively for Partners and Customers from early December 2015.
Checkout the press release reports to get to know more about what coming in the next release!

Thursday, November 26, 2015

Dynamics AX 2012 R3 CU10 released

The latest cumulative update of hotfixes for the AX 2012 R3 has been released from LCS, the original release post from the Dynamics AX in Market Engineering team can be found here. The latest build has been updated to 6.3.3000.110 but if you use slip stream option for a full installation the build number will be shown as 6.3.3000.111.
Coming back to the post what's updated in the latest hotfix basket in Retail, probably the most important is the POS performance. The biggest strength in the Retail POS is its ability to automatically calculate the best discount that can be applied to the transaction based on the products/store/customer/period combinations. But it turns out to be the biggest performance backdrop if the discounts/products increases more than tens of thousands of records. It seems there has been some issues addressed for these scenarios by adding a maximum number of steps/loops before the best price has been picked up for the product within the shopping cart. And this has been implemented as a configuration in the Retail parameters. The functionality should have come long time back, even though too late but better now than never.

Wednesday, August 26, 2015

Retail Time Clock Entries

If you have been using the Retail Module, you might have noticed there are couple of operations called Time Clock and View Time Clock.



The time clock operations enable the Store to capture the Cashier/Supervisors working shift schedule by capturing their clock in/out information. The functionalities enables HQ to capture the exact times that a cashier has come for work, duration of breaks and when he signed off for the day. This is not linked to the Login/Log off details of the cashiers but built as a decoupled functionality to store the time registrations for employees.
The huge potential that we can see it is fully integrated with the Retail and HR module, enabling you to generate working time reports or send this data to payroll systems to process the cashiers salary. Please do note the operations performed in the Time clock entries are all real time meaning the Terminal should be fully online and active connection available to make the time clock entries. Before you can start using the Time registration for Employees, make sure to activate Time registration in terminals for those employees.
After you have made some Clock in/Break For Lunch/Clock out, you can immediately start seeing the Time registration transactions under the Worker > Time Registration Tab > Journal Registrations.



Tuesday, August 11, 2015

Azure Marketplace - Evaluation version for Dynamics AX 2012 R3

Life Cycle Services has just announced in their July 2015 Release that they are releasing the Evaluation version of AX for all Customers and Partners. This follows a similar concept of Dynamics CRM when they offered a 30 day trials for anyone who wanted to try the CRM online. 
The details that you would need is a valid LCS account and Azure portal access, some of the other details that you need to select/check are Location, Sizing, LCS project and T&C's. Currently you will only be able to deploy the AX 2012 R3 version, and it aptly seems to pave the way for the AX 7.0 version which is supposed to be fully web based client. You can access the Market place for Dynamics AX Evaluation copy from this link. Have fun with the evaluation versions and make sure your Azure subscriptions don't burn up too quickly by turning off the VM's when not in use.


Saturday, July 11, 2015

Easily move Retail Till Layouts between environments

Many of the times we would like to see the Till layout in our Live environment on our Testing instance. The usual way would be to replicate manually the changes on the Till layout designer one by one or move the complete transaction DB from Live to Testing instance. Both of which will give a lot of downtime or a bit cumbersome! A easy hack to replicate the details would be to just copy over all the relevant tables via SQL insert. I had went through the table relationships and have compiled the necessary ones which you can use for the copy functionality. The data for design is predominantly saved as XML data which is used by the .NET runtime on POS for building the layout or an activeX component for designer in AX which allows for layout changes. At no point you should manipulate the XML data directly as it can make the layout to crash, we need to allow the ActiveX designer to generate the XML data, that's one of the reasons you need to provide additional Read/Write permissions for AX database for the users who manage the Till Layout designs.
The list of tables that are involved in the Till Layouts are,
  • RETAILBUTTONGRID
  • RETAILBUTTONGRIDBUTTONS
  • RETAILIMAGES
  • RETAILTILLLAYOUT
  • RETAILVISUALPROFILE
  • RetailDeviceTypes
  • RetailPOSTheme
  • RetailTillLayoutZone
  • RetailTillLayoutZoneReference


AX 2012 R2 has the first 5 tables as the remaining tables were included in R3 with the introduction of MPOS. And here is the sample SQL Select into statement, please make sure you've moved the records in Testing table to a backup table before executing the statement.

select * into [--TestInstance--].[dbo].[RETAILBUTTONGRID]
 from [--LiveInstance--].[dbo].[RETAILBUTTONGRID] 

Kindly test carefully and evaluate relationships of the tables to be sure there has not been any changes incorporated by Microsoft in version or hotfix changes.

Tuesday, June 16, 2015

Dynamics AX 2012 R3 CU9 Released

AX 2012 R3 CU9 is officially released with the KB3063879. The release has been positioned only for AX 2012 R3 hence it seems the previous releases for R1 and R2 will need to wait a bit longer. An attractive option for the CU9 release is if the existing environment is linked to LCS they you may upgrade it directly from LCS website. Here is the link to the actual release which has all the information and notes related to Installation guides and change history.

Tuesday, May 19, 2015

MB6-701 Dynamics AX 2012 Retail Certification successfully cleared

Hurray! I've managed to complete the AX 2012 Retail certification yesterday. During registrations probably first thing you will notice is Microsoft will direct us to Pearson VUE instead of Prometric. I wanted to grab the second shot offer before it ends this month end so I quickly scheduled it for this week based on the online slots available. 
The exam duration is 1.5 hours for 50 questions and the testing UI felt more like a windows app. Most of the questions are modeled based on how we apply the retail concepts and configuration setups rather than direct question and answers. If you have enough experience configuring the retail components this should not be an issue. Using the elimination rule for the options will come in handy to arrive at the correct answer. For the time being am just glad I didn't need to use the second shot offer!



Friday, April 24, 2015

Retail Transaction Service Connection - Error 13010 Could not connect to the Transaction Service

The retail transaction service on the POS can get cranky at times by not being able to reach the backoffice HQ to do a specific operation. The error message for 13010 is very generic meaning there is a connection issue between POS client and Retail Transaction service. More indepth details can be found from the Event viewer log where the error arises. The current issue in discussion happened when there was a sudden failure due to Business connector for Transaction service was unable to access Dynamics AX.

There are a few possible causes for the error could be due to permissions and rights issue for the business connector service account which might have been modified by the system administrator. If that's not the case and you are sure that the service account was not changed recently then it is recommended to Reset the IIS. The IIS reset will refresh the security tokens that might have linked to the service accounts. The business connector in my case was able to successfully connect back to AX after the IIS reset and Transaction service was back to normal.


Detailed event viewer entries
1)
LSRetailPosis.TransactionServices.InvokeMethod: System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. ---> System.ServiceModel.FaultException: An error occurred when verifying security for the message.
   --- End of inner exception stack trace ---

Server stack trace:
   at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)
   at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout)
   at System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout)
   at System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout)
   at System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ReliableChannelBinder`1.ChannelSynchronizer.SyncWaiter.TryGetChannel()
   at System.ServiceModel.Channels.ReliableChannelBinder`1.ChannelSynchronizer.SyncWaiter.TryWait(TChannel& channel)
   at System.ServiceModel.Channels.ReliableChannelBinder`1.ChannelSynchronizer.TryGetChannel(Boolean canGetChannel, Boolean canCauseFault, TimeSpan timeout, MaskingMode maskingMode, TChannel& channel)
   at System.ServiceModel.Channels.ReliableChannelBinder`1.Send(Message message, TimeSpan timeout, MaskingMode maskingMode)
   at System.ServiceModel.Channels.SendReceiveReliableRequestor.OnRequest(Message request, TimeSpan timeout, Boolean last)
   at System.ServiceModel.Channels.ReliableRequestor.Request(TimeSpan timeout)
   at System.ServiceModel.Channels.ClientReliableSession.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ClientReliableDuplexSessionChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Dynamics.Retail.TransactionServices.ClientProxy.ITransactionService.InvokeMethod(RequestInfo requestInfo, String methodName, Object[] parameters)
   at LSRetailPosis.TransactionServices.InvokeMethod(String methodName, Object[] parameters).


2)
BC.Net connectivity failure.AXNET.Logon() method called with Company: null | Language: null | ObjectServer:

   at Microsoft.Dynamics.BusinessConnectorNet.Axapta.Logon(String company, String language, String objectServer, String configuration)
   at Microsoft.Dynamics.Retail.TransactionServices.AxaptaWrapper.CreateAxapta(RequestInfo info)

3)
Axapta.Logon() failed. Exception details: Microsoft.Dynamics.AX.ManagedInterop.NoSecurityKeyException
   at Microsoft.Dynamics.BusinessConnectorNet.Axapta.Logon(String company, String language, String objectServer, String configuration)
   at Microsoft.Dynamics.Retail.TransactionServices.AxaptaWrapper.CreateAxapta(RequestInfo info)

Retail Transaction Service Error for NET.TCP

There can be situations when the real time service for a store suddenly stops working if it uses the net.tcp protocol to communicate with back office AX. You will be provided with a connection unsuccessful exception from the server due to time out. And a generic error during an operation For Eg:- Recall Sales order operation from the POS as "An error occurred while refreshing the list". A closer look at the event POS will provide insights into the net.tcp error log like below.


Microsoft.Dynamics.Retail.Pos.SalesOrder.WinFormsTouch.frmGetSalesOrder, Text: Sales orders: LSRetailPosis.PosisException ---> System.ServiceModel.EndpointNotFoundException: Could not connect to net.tcp://server.ttprod.local:8190/RealTimeService/Service.svc/Common. The connection attempt lasted for a time span of 00:00:01.0312456. TCP error code 10061: No connection could be made because the target machine actively refused it 172.xx.xx.xxx:8190.  ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 172.xx.xx.xxx:8190
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
   at System.ServiceModel.Channels.SocketConnectionInitiator.Connect(Uri uri, TimeSpan timeout)

   --- End of inner exception stack trace ---

The server had actively refused the connection for net.tcp connection as the listener port was not started for the service. The listener Port for the network adapter can be activated on the server from the Services > NET.TCP Listener Adapter and starting the service.


Tuesday, January 6, 2015

Retail - Process upload jobs encountered error

You might encounter an conversion error when the Async client tries to create an upload job from the Retail transactions, more specifically it is a decimal to integer SQL conversion cast error. The error will cause the Async client to throw an overflow exception and fall face down on the belly everytime "that" retail transaction is processed for upload package. How do you resolve it and why it occurred in the first place?
Am going to be frank, in production you will get an heart attack when you see this error on the event log when the trickle transactions are not coming back, there is no hint of why or how it happens. So put on your sherlock holmes hat and start your investigation for some clues to solve this error.
First lets see the Why part, the Async client raises the exception when it tries to create a package for one of the columns in the upload tables which has a values larger than what an integer can hold. Yes it can happen if the cashier accidentally scans a 13 digit EAN 13 barcode to a Quantity or Price field. The scanners at the Hypermart cashiers are always ON meaning while tendering if the product barcode could get scanned. Remember the scanner is programmed to add line feed <Enter> there by committing the transaction. So if it was at cash tender for 10$, and a barcode does gets scanned then the system will take 888,345,782,1090 and return the Change back as 888,345,782,1080. No issues now as the RetailTransactionPaymentTrans table record is created with this gigantic value and sale gets completed. The real exception comes when the Pull jobs starts to create records for this transaction. And the upload job will not proceed after this transaction and there by no transactions will trickle feed back to HQ.

Simple script to identify the issue by Qty or Amount
Select * from RetailTransactionSalesTrans where Qty < -50000
Select * from RetailTransactionSalesTrans where NetAmount < -500000

How do you solve this then, if it is a test environment just truncate all the transaction tables and you would be good to go immediately. The async client springs back to action and will start churning out the upload job packages. But for those unfortunate ones when the issue occurs in production you would have to wait and find the transaction and then cleanse it before the async client can limp back again. 
A clearer understanding of the exception is more important on how it can be handled, the error is triggered by the SQL during the CAST of a column value which is in Decimal to Integer which exceeds either +/-7922816251426. Yes, thats all! Async client never tells you which transaction, value, column or even table during the exception. So you need figure it out based on the exception when it started, last complete Retail Transaction that was synced and which store the exception occurs.
Based on my experience I went through, the last perfect sync of Retail Sales was at 10:20 PM, the error started occurring at 10:40 PM for that store async client. I took a list of all the tables handled in upload job and compared one by one if they had any columns which had disproportionately high values. Below is the complete list for R3 RTM version:-

RetailFiscalDocumentModel2_BR
RetailFiscalDocumentModel2Line_BR
RetailFiscalDocumentModel2TaxTrans_BR
RetailFiscalPrinter_BR
RetailFiscalPrinterReport_BR
RetailFiscalReceipt_BR
RetailFiscalReceiptLine_BR
RetailFiscalReceiptTaxTrans_BR
RetailListingStatusLog
RetailPosBatchAccountTrans
RetailPosBatchTable
RetailPosBatchTenderTrans
RetailTransactionAddressTrans
RetailTransactionAffiliationTrans
RetailTransactionAttributeTrans
RetailTransactionBankedTenderTrans
RetailTransactionDiscountTrans
RetailTransactionIncomeExpenseTrans
RetailTransactionInfocodeTrans
RetailTransactionKitsDisassemblyTrans
RetailTransactionLoyaltyRewardPointTrans
RetailTransactionMarkupTrans
RetailTransactionOrderInvoiceTrans
RetailTransactionPaymentTrans
RetailTransactionPaymentTrans_BR
RetailTransactionSafeTenderTrans
RetailTransactionSalesTrans
RetailTransactionTable
RetailTransactionTable_RU
RetailTransactionTaxTrans
RetailTransactionTenderDeclarationTrans
RetailZReport_BR
RetailZReportTotalizer_BR

Most are useless tables which contain little to no data, just cross of them. The major tables of interest for you should be those that start with RetailTransactionxxxxx and RetailPOSBatchxxx tables. I started narrowing down all the transactions after 10:20 PM but before the 10:40 for these tables.
Try to do a SQL Cast to simulate how the async client goes belly up, for suspected columns. After a through investigation the RetailPOSBatchxxxx were pretty much harmless meaning even if it has a some large values they are handled properly in the code and data seems to flow back to AX. Then shifted my real focus to transaction tables, use a stored procedure to type cast and simulate faster for all the records which have values larger than 5 digits for either Qty or Amount columns.

Sample Scripts for RetailPOSBatchTenderTrans Table

Simple script

Select CAST(TENDEREDAMOUNT as int),cast(TENDEREDAMOUNTCUR AS int),* FROM RETAILPOSBATCHTENDERTRANS 

Detailed script for analyzing line by line

Declare @v_TRANSACTIONID nvarchar(44), @v_TERMINAL nvarchar(10), @i int,@v_date Datetime, @v_AmountTen as int,
@v_TransTime as  int,@v_BATCHID as int,@v_TENDEREDAMOUNT as decimal,@v_TENDEREDAMOUNTCUR as decimal,
@v_int1 as int, @v_Int2 as int 

Declare cur_temp cursor for
Select TOP 200 TERMINALID,BATCHID,TENDEREDAMOUNT,TENDEREDAMOUNTCUR FROM RetailPosBatchTenderTrans 


OPEN cur_temp   
FETCH NEXT FROM cur_temp INTO  @v_TERMINAL,@v_BATCHID,@v_TENDEREDAMOUNT,@v_TENDEREDAMOUNTCUR
Set @i = 0

WHILE @@FETCH_STATUS = 0   
BEGIN   
Print '@v_TERMINAL    ' + CAST(@v_TERMINAL AS varchar(1000))
Print '@@v_BATCHID    ' + CAST(@v_BATCHID AS varchar(1000))

SET @v_int1 = CAST(@v_TENDEREDAMOUNT as int)
Print '@v_int1    ' + CAST(@v_int1 AS varchar(1000))

SET @v_int2 = CAST(@v_TENDEREDAMOUNTCUR as int)
Print '@@v_TENDEREDAMOUNTCUR    ' + CAST(@v_int2 AS varchar(1000))

set @i = @i + 1

print '-----completed--- i = ' + CAST(@i as varchar(10))
print '---------------------------------'



     FETCH NEXT FROM cur_temp INTO  @v_TERMINAL,@v_BATCHID,@v_TENDEREDAMOUNT,@v_TENDEREDAMOUNTCUR
END   

CLOSE cur_temp   
DEALLOCATE cur_temp 

Repeat the steps for each of the table in the RetailTransactionTable series.
Finally found that a CAST on AmountMST columns value in RetailTransactionPaymentTrans triggers the arithmetic conversion overflow exception, exactly the one I am looking for from the Async client. The transaction seems to have been exceptionally higher than the one which can be held by an integer.
There the error popped out, got a quick approval for amending the payment amount and change back transactions from the Client to modify on Production store database. Make sure to make the value come down to acceptable range for an integer, preferable to provide a realistic value like $10 for a sales transaction that was for $7.20.
Perform the steps -> Stop the async client, commit the new values in affected transaction(multiple columns might be present in same table like PaymentAmount, AmountMST, AmountCur, etc change all to new value) and start again the async client. If you had identified the column and value correctly the upload job should start kicking again with packages, else if you get the error. Make sure to double check the same columns again if there is still any other columns that has the value. By and large the issue should have solved after you patch the transaction data.
How to avoid this scenario entirely even before it happens? Yes possible by adding some validations for Quantity and Price. Example, Make sure to always set a maximum tender amount for each tender type, for me $100,000 is a wishful figure and there would not be sale with 1 tender type with more than $100,000. So in this case even if the barcode got scanned, the amount validation will stop the payment from being completed.

For those who managed to solve please do share in the comments your approach that helped you, it could really help someone to solve the issue on production environment.

Reference Detailed Exception Log:
Process upload jobs encountered Exception. Error Details: System.OverflowException: Conversion overflows.
   at System.Data.SqlClient.SqlBuffer.get_Decimal()
   at System.Data.SqlClient.SqlBuffer.get_Value()
   at System.Data.SqlClient.SqlDataReader.GetValue(Int32 i)
   at Microsoft.Dynamics.Retail.StoreConnect.Request.SQLHandler.SCSqlReadRequestRunner.Run(SqlConnection connection, SqlTransaction transaction)
   at Microsoft.Dynamics.Retail.StoreConnect.Request.SQLHandler.SCSqlSourceRequestHandler.ProcessReadRequests(SqlConnection connection, SqlTransaction transaction)
   at Microsoft.Dynamics.Retail.StoreConnect.Request.SQLHandler.SCSqlSourceRequestHandler.ProcessSourceRequestHeader(ISCSourceRequestHeader sourceRequestHeader)
   at Microsoft.Dynamics.Retail.SynchClient.Core.UploadAgent.PackRequestResultsToFile(SessionManager sessionMgr, ISCSourceRequestHeader header, String fileName)
   at Microsoft.Dynamics.Retail.SynchClient.Core.UploadAgent.ProcessUploadJob(Job activeJob)System.OverflowException: Conversion overflows.
   at System.Data.SqlClient.SqlBuffer.get_Decimal()
   at System.Data.SqlClient.SqlBuffer.get_Value()
   at System.Data.SqlClient.SqlDataReader.GetValue(Int32 i)
   at Microsoft.Dynamics.Retail.StoreConnect.Request.SQLHandler.SCSqlReadRequestRunner.Run(SqlConnection connection, SqlTransaction transaction)
   at Microsoft.Dynamics.Retail.StoreConnect.Request.SQLHandler.SCSqlSourceRequestHandler.ProcessReadRequests(SqlConnection connection, SqlTransaction transaction)
   at Microsoft.Dynamics.Retail.StoreConnect.Request.SQLHandler.SCSqlSourceRequestHandler.ProcessSourceRequestHeader(ISCSourceRequestHeader sourceRequestHeader)
   at Microsoft.Dynamics.Retail.SynchClient.Core.UploadAgent.PackRequestResultsToFile(SessionManager sessionMgr, ISCSourceRequestHeader header, String fileName)
   at Microsoft.Dynamics.Retail.SynchClient.Core.UploadAgent.ProcessUploadJob(Job activeJob)