Error: Cannot change primary ID (itemMatrixID)
Updated over a week ago

There was an error when importing item with description 'Description': BadRequest: <?xml version="1.0"?> <Error><httpCode>400</httpCode> <httpMessage>Bad Request</httpMessage><message>Cannot change primary ID (itemMatrixID) of model_ItemMatrix once it has been set.</message><errorClass>PrimaryKeyError</errorClass></Error>

This error means that the import template included a line item which has already been assigned to a Matrix in Lightspeed and the import is instructing Lightspeed to do one of the following:

  1. Reassign the item to a new Matrix.

  2. Remove the item from the Matrix.

We've confirmed in tests that Lightspeed does not allow items to be removed from a Matrix via their API, even when trying to assign them to a new Matrix.

An alternative solution here would be to do the following:

  1. Within Lightspeed manually remove these items from the matrix they're assigned to. This can be done in each Lightspeed Matrix by navigating to the Matrix Setup page, and clicking the X next to each group item you want to remove.

  2. If these items need to be assigned to a new matrix, a new import can be processed via DataTools to assign the now unassigned items to new matrices in bulk.

Please contact Accumula Support if you have any questions.

Did this answer your question?