web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Bar-code items on Retail POS

(0) ShareShare
ReportReport
Posted on by

Hi all,

I have set up a number of products in AX and released them to the store. Items are being recognised when inputting the item id but when inputting the barcode nothing happens.

If a non-existing barcode is inputted then an error is thrown by the POS that the item was not found, but if the barcode exists, nothing happens from the POS side. 

It was noted from the event viewer the following error:

LSRetailPosis.POSProcesses.ProcessInput: System.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK__#A75B4DB__A9A5B3BBC145E879'. Cannot insert duplicate key in object 'dbo.@tvp_ProductIds'. The duplicate key value is (52565550704).
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Dynamics.Retail.Pos.BarcodeService.Barcode.Find(IBarcodeInfo barcodeInfo, Boolean promptIfMultiple)
at Microsoft.Dynamics.Retail.Pos.BarcodeService.Barcode.ProcessBarcode(IScanInfo scanInfo)
at LSRetailPosis.POSProcesses.ProcessInput.Execute()
ClientConnectionId:405c6ba6-a87c-401a-8b89-fdb17c3fb010
Error Number:2627,State:1,Class:14.

Any help please?

*This post is locked for comments

I have the same question (0)
  • Rodolfo Recalde Profile Picture
    on at

    Hi,

    The message gives a clue of the problem:

    "Violation of PRIMARY KEY ....

    ....Cannot insert duplicate key in object 'dbo.@tvp_ProductIds'.

    The duplicate key value is (52565550704)."

     

    Check for customizations that can impact this table (index/logic).

    I Hope this Helps,

    Regards,

    Rodolfo Recalde.

     

  • Mauro Pedro da Silva Profile Picture
    552 on at

    To help your troubleshoot, once you key in the Item code, click the operation "View product details". You should see the barcode for the item and analyze if it makes sense.

  • Community Member Profile Picture
    on at

    Hi, this is a standard Dynamics AX R3 CU10 instllation using Contoso.

  • RAVINDER RANA Profile Picture
    685 on at

    search the  product(having barcode ) through product search operation on POS and click on product details . you should see the barcode on product details form  if it is linked with the product.

  • Zaheen82 Profile Picture
    on at

    Hello,

    It seems  you used same barcode for different procducts.

    This is causing a duplication error.

    I had same issue with barcoding some weeks back.

    In fact the POS is returning the Product but with a blank descriction.

    Solution:

    Delete the duplicate lines from the table InventItemBarcode

    Re assign your barcode manually.

    Re sync with POS.

    Regards,

    Zaheen

  • Community Member Profile Picture
    on at

    unfortunately no, this is not the issue. There are no duplicate barcodes in InventItemBarcode.

  • Suggested answer
    Community Member Profile Picture
    on at

    Hello,

    I had the same issue after AX HQ database was restored from SQL backup.

    You can check the channel database, find the appropriate records and delete them manually.

    Regards,

    Denis

  • Community Member Profile Picture
    on at

    any specific tables?

  • Verified answer
    Community Member Profile Picture
    on at

    Hello Czs.

    I guess you should probably have fixed this by now, but nevertheless i will explain the problem. It happened to me when using Contoso and changing an item barcode to one of the existing items. If the item you changed was released in several companies (i.e. FRRT, USRT) then when being used in Retail, and when using the barcode reading classes, Retail uses this query that finds the related item but misses at some point of that query (missing a Dataareaid in the where clause). Then in our case, it brings 2 records, and when it tries to insert them in the table (tbl_Productsid) SQL Server gives the error you wrote.

    If it is for demo purposes, just go to the channel database you're using and find InventTable, delete the item(s) you're using that have Dataareaids different from the one you're giving the demo with.

    I hope this helps!

    Randall

  • Suggested answer
    Community Member Profile Picture
    on at

    I have sorted out this issue by creating a new data group for my store on the Contoso data, remove my store from all data groups and do a full synchronization.

    The issue was sorted out, and barcodes were successfully scanned.

    Your solution makes sense as well though, because the primary issue was duplicate values.

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans