Friday, July 3, 2015

POS Number Sequence Details : RetailPOSSeedData (Table) : Dynamics AX 2012 R3 CU8

Retail POS seed data table is used to hold number sequence details for stores. For example:

DataType
DataValue
StoreNumber
TerminalId
DataArea
Transaction ID
140
BOSTON
Boston_01
USRT
Shift ID
12
BOSTON
Boston_01
USRT
Receipt sale
10
BOSTON
Boston_01
USRT
Receipt return
12
BOSTON
Boston_01
USRT
Receipt default
11
BOSTON
Boston_01
USRT
Receipt sales order
13
BOSTON
Boston_01
USRT
Receipt sales invoice
13
BOSTON
Boston_01
USRT
Receipt payment
2
BOSTON
Boston_01
USRT
Retail log id
2
BOSTON
Boston_01
USRT

Fields-
·         DataType refers the type of the transaction takes place at POS system.
·         DataValue refers the current number of transaction takes place.
·         StoreNumber is the identifier for channel.
·         TerrminalID is the identifier for a register (POS) under the channel.

In the POS side, there is an equivalent table named as “ax.RETAILPOSSEEDDATA”. For any activity in POS such as login, logout, sales, receipt etc. POS uses this table to get the data value specific to data type (transaction type). If no record is found based on a datatype, a record is created with incremented datavalue and update the datavalue to reserve the next number for a datatype. If record is found it just increment and update the datavalue. The store procedure “[crt].[GETNEXTNUMBERSEQUENCEVALUE]”  in the store database is responsible for this activity.


This store procedure also returns the current numbers to be used for the fields TransactionID, ReceiptID
 in the table “ax.RETAILTRANSACTIONTABLE”. The P-job sends the data periodically from this table to back office (AX) in the equivalent table “RetailTransactionTable”

 In order to view the current seed data, Go to Retail>Periodic>Retail POS Redeployment form.

 
In order to calculate the POS number sequence details for a register, create a new record and select the store and register.  Click the button “Calculate POS number sequence”. This will call a static method in the RetailPOSSeedData to calculate the current used numbers for different data type.
You may edit this numbers using “Edit POS number seq..” and set new numbers and push the data back to POS. Use the scheduler job 1160 (POS redeployment) to perform this.  Based on this, a new number sequence will be generated in the POS. But, if the “ax.RETAILTRANSACTIONTABLE” has already a records with same number POS transaction will not take palce successfully due to duplicate key error as follows:

Violatio  of PRIMARY KEY constrain. Cannot insert duplicate key in object ‘ax.RETAILTRANSACTIONTABLE’.




To void such error, try to setup the CDX components so that the transaction at POS sync to AX. Use the above form to calculate POS number sequence and push this data using 1160 job back to POS. Once the data is updated to POS, it will start creating transaction based on next number.

6 comments:

  1. Thank you, this is very informative and assisted to sort this error which i was having for some time

    ReplyDelete
  2. I think your post is very good, EPOS System rather I would have liked to read a bit more about this topic because I think it is quite interesting. So i look forward to see next updates

    ReplyDelete
  3. Thank full , epos software he was new Way to help to us to get the business running sucessfull.

    ReplyDelete
  4. This worked for 1 bill after POS redeployment and same error again

    ReplyDelete