Data Migration Error

Hei all.

In my CSV file , i have product dimensions with me and using that values i have written a new method for generating InventDimId but when the data is being copied from Staging to Target table , it throws an error

“Cannot create a record in Stock dimensions” . The record already exists…however there is no such data in the table.

I am using the standard entity of Asset and added a new datasource of InventDim in its Query.

I do not know what i am doing wrong here but needed help from you guys.

Can you verify in the debugger that the right values are being inserted to the table? The database doesn’t return the error without reason, we just have to analyze what exactly is going on.

Yes Martin.

I debugged the code and in that all the dimensions value as well as InventDimId field is being populated and all are different everytime.

Still it throws error regarding the table.

How did you verify that the record didnn’t exist? What if it was created in the same transaction?

Also try to insert the same values from a job. If it fails, you don’t have to bother importing code anymore.

Actually while debugging i noticed the InventdimId created and when after the process was over, i navigated to the table browser and searched for that value but it did not existed.

But as you suggested i will try through the job to perform the same and will let you know.