Transfering Products, and their associated options/variants

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
dave_reach
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 32
Joined: Mon Jan 28, 2008 10:05 am

Transfering Products, and their associated options/variants

Post by dave_reach » Wed Sep 24, 2008 3:24 am

Hi,

A client of ours has two AbleCommerce stores. They wish to copy some products from Store 1 to Store 2.

They only want to transfer the Products contained within the "Sneakers" category of store 1. Store 2 does not have the same Categories or Manufacturers as Store 2.

I have successfully used Able's Data Port utility to create and upload a CSV file - however this only contains the basic product information, not the Options/Choices and Variants - of which there is a large number.

If I try to create an XML file using the Data Port utility > Customized Downloads > Selected Products, the XML file contains all the data I require, however I cannot upload this to Store 2 as Foreign Key errors are thrown.

Is there any way I can transfer the data I need without having these errors?

Thanks,
Dave.

I have attached the log from the attempted import below.

Code: Select all


Store Import(Upload) Log	Dated:24/09/2008 09:59:11
User Name:- dave@reachbcs.com
Store:- (DEV) Ballroom Central
Service URL:- http://localhost/ballroomcentral/clientapi/ClientApiService.ashx
Start Time:- 24/09/2008 09:59:11	End Time:- 24/09/2008 09:59:11
Import(Upload) Items:- Products
Imported File:- C:\Documents and Settings\Gareth\My Documents\Data Port\DW Sneakers to BR\bw-2-br-sneakers.xml
*****************************************
Server Log:-


Importing 9 Products

Exception has been thrown by the target of an invocation.
ImportOrUpdate unsuccessful for Product
ProductId = 277
Name = Freedom
Error message: Exception has been thrown by the target of an invocation.

   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.<.ctor>b__d0(Object& acObject)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.ImportChildObjectsArray(Array schemaObjectsArray, Type acType, String objName, String idFieldName, String displayNamePropertyName, Object parentId, TryLoadExistingObject tryLoadExistingObject, TranslateObjectAssociatedIds translateObjectAssociatedIds, SaveACObject saveACObject, ImportObjectChildsAndAssociations importObjectChildsAndAssociations)

Base Exception: The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Manufacturers_ac_Products_FK1". The conflict occurred in database "BallroomCentral", table "dbo.ac_Manufacturers", column 'ManufacturerId'.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   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)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteScalar(DbCommand command)
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar(DbCommand command)
   at CommerceBuilder.Products.Product.BaseSave()
   at CommerceBuilder.Products.Product.Save()

Exception has been thrown by the target of an invocation.
ImportOrUpdate unsuccessful for Product
ProductId = 278
Name = Web
Error message: Exception has been thrown by the target of an invocation.

   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.<.ctor>b__d0(Object& acObject)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.ImportChildObjectsArray(Array schemaObjectsArray, Type acType, String objName, String idFieldName, String displayNamePropertyName, Object parentId, TryLoadExistingObject tryLoadExistingObject, TranslateObjectAssociatedIds translateObjectAssociatedIds, SaveACObject saveACObject, ImportObjectChildsAndAssociations importObjectChildsAndAssociations)

Base Exception: The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Manufacturers_ac_Products_FK1". The conflict occurred in database "BallroomCentral", table "dbo.ac_Manufacturers", column 'ManufacturerId'.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   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)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteScalar(DbCommand command)
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar(DbCommand command)
   at CommerceBuilder.Products.Product.BaseSave()
   at CommerceBuilder.Products.Product.Save()

Exception has been thrown by the target of an invocation.
ImportOrUpdate unsuccessful for Product
ProductId = 279
Name = Evolution
Error message: Exception has been thrown by the target of an invocation.

   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.<.ctor>b__d0(Object& acObject)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.ImportChildObjectsArray(Array schemaObjectsArray, Type acType, String objName, String idFieldName, String displayNamePropertyName, Object parentId, TryLoadExistingObject tryLoadExistingObject, TranslateObjectAssociatedIds translateObjectAssociatedIds, SaveACObject saveACObject, ImportObjectChildsAndAssociations importObjectChildsAndAssociations)

Base Exception: The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Manufacturers_ac_Products_FK1". The conflict occurred in database "BallroomCentral", table "dbo.ac_Manufacturers", column 'ManufacturerId'.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   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)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteScalar(DbCommand command)
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar(DbCommand command)
   at CommerceBuilder.Products.Product.BaseSave()
   at CommerceBuilder.Products.Product.Save()

Exception has been thrown by the target of an invocation.
ImportOrUpdate unsuccessful for Product
ProductId = 280
Name = Boost DRT
Error message: Exception has been thrown by the target of an invocation.

   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.<.ctor>b__d0(Object& acObject)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.ImportChildObjectsArray(Array schemaObjectsArray, Type acType, String objName, String idFieldName, String displayNamePropertyName, Object parentId, TryLoadExistingObject tryLoadExistingObject, TranslateObjectAssociatedIds translateObjectAssociatedIds, SaveACObject saveACObject, ImportObjectChildsAndAssociations importObjectChildsAndAssociations)

Base Exception: The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Manufacturers_ac_Products_FK1". The conflict occurred in database "BallroomCentral", table "dbo.ac_Manufacturers", column 'ManufacturerId'.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   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)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteScalar(DbCommand command)
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar(DbCommand command)
   at CommerceBuilder.Products.Product.BaseSave()
   at CommerceBuilder.Products.Product.Save()

Exception has been thrown by the target of an invocation.
ImportOrUpdate unsuccessful for Product
ProductId = 281
Name = Boomelight 63C
Error message: Exception has been thrown by the target of an invocation.

   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.<.ctor>b__d0(Object& acObject)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.ImportChildObjectsArray(Array schemaObjectsArray, Type acType, String objName, String idFieldName, String displayNamePropertyName, Object parentId, TryLoadExistingObject tryLoadExistingObject, TranslateObjectAssociatedIds translateObjectAssociatedIds, SaveACObject saveACObject, ImportObjectChildsAndAssociations importObjectChildsAndAssociations)

Base Exception: The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Manufacturers_ac_Products_FK1". The conflict occurred in database "BallroomCentral", table "dbo.ac_Manufacturers", column 'ManufacturerId'.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   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)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteScalar(DbCommand command)
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar(DbCommand command)
   at CommerceBuilder.Products.Product.BaseSave()
   at CommerceBuilder.Products.Product.Save()

Exception has been thrown by the target of an invocation.
ImportOrUpdate unsuccessful for Product
ProductId = 282
Name = Boomelight HTop 62L
Error message: Exception has been thrown by the target of an invocation.

   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.<.ctor>b__d0(Object& acObject)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.ImportChildObjectsArray(Array schemaObjectsArray, Type acType, String objName, String idFieldName, String displayNamePropertyName, Object parentId, TryLoadExistingObject tryLoadExistingObject, TranslateObjectAssociatedIds translateObjectAssociatedIds, SaveACObject saveACObject, ImportObjectChildsAndAssociations importObjectChildsAndAssociations)

Base Exception: The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Manufacturers_ac_Products_FK1". The conflict occurred in database "BallroomCentral", table "dbo.ac_Manufacturers", column 'ManufacturerId'.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   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)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteScalar(DbCommand command)
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar(DbCommand command)
   at CommerceBuilder.Products.Product.BaseSave()
   at CommerceBuilder.Products.Product.Save()

Exception has been thrown by the target of an invocation.
ImportOrUpdate unsuccessful for Product
ProductId = 283
Name = Helium
Error message: Exception has been thrown by the target of an invocation.

   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.<.ctor>b__d0(Object& acObject)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.ImportChildObjectsArray(Array schemaObjectsArray, Type acType, String objName, String idFieldName, String displayNamePropertyName, Object parentId, TryLoadExistingObject tryLoadExistingObject, TranslateObjectAssociatedIds translateObjectAssociatedIds, SaveACObject saveACObject, ImportObjectChildsAndAssociations importObjectChildsAndAssociations)

Base Exception: The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Manufacturers_ac_Products_FK1". The conflict occurred in database "BallroomCentral", table "dbo.ac_Manufacturers", column 'ManufacturerId'.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   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)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteScalar(DbCommand command)
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar(DbCommand command)
   at CommerceBuilder.Products.Product.BaseSave()
   at CommerceBuilder.Products.Product.Save()

Exception has been thrown by the target of an invocation.
ImportOrUpdate unsuccessful for Product
ProductId = 284
Name = Space
Error message: Exception has been thrown by the target of an invocation.

   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.<.ctor>b__d0(Object& acObject)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.ImportChildObjectsArray(Array schemaObjectsArray, Type acType, String objName, String idFieldName, String displayNamePropertyName, Object parentId, TryLoadExistingObject tryLoadExistingObject, TranslateObjectAssociatedIds translateObjectAssociatedIds, SaveACObject saveACObject, ImportObjectChildsAndAssociations importObjectChildsAndAssociations)

Base Exception: The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Manufacturers_ac_Products_FK1". The conflict occurred in database "BallroomCentral", table "dbo.ac_Manufacturers", column 'ManufacturerId'.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   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)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteScalar(DbCommand command)
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar(DbCommand command)
   at CommerceBuilder.Products.Product.BaseSave()
   at CommerceBuilder.Products.Product.Save()

Exception has been thrown by the target of an invocation.
ImportOrUpdate unsuccessful for Product
ProductId = 344
Name = Impact 
Error message: Exception has been thrown by the target of an invocation.

   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.<.ctor>b__d0(Object& acObject)
   at CommerceBuilder.DataClient.Api.ObjectHandlers.ImportHandler.ImportChildObjectsArray(Array schemaObjectsArray, Type acType, String objName, String idFieldName, String displayNamePropertyName, Object parentId, TryLoadExistingObject tryLoadExistingObject, TranslateObjectAssociatedIds translateObjectAssociatedIds, SaveACObject saveACObject, ImportObjectChildsAndAssociations importObjectChildsAndAssociations)

Base Exception: The INSERT statement conflicted with the FOREIGN KEY constraint "ac_Manufacturers_ac_Products_FK1". The conflict occurred in database "BallroomCentral", table "dbo.ac_Manufacturers", column 'ManufacturerId'.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
   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)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
   at System.Data.SqlClient.SqlCommand.ExecuteScalar()
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.DoExecuteScalar(DbCommand command)
   at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar(DbCommand command)
   at CommerceBuilder.Products.Product.BaseSave()
   at CommerceBuilder.Products.Product.Save()
9 Product(s) imported, 0 Product(s) updated.
Product(s) Import Complete...

User avatar
Naveed
Rear Admiral (RADM)
Rear Admiral (RADM)
Posts: 611
Joined: Thu Apr 03, 2008 4:48 am

Re: Transfering Products, and their associated options/variants

Post by Naveed » Thu Sep 25, 2008 12:20 am

As your products are related to some other objects like Manufactures, so when importing the XML only for products from one store to other store will not be successful. It is because the related objects are not present at that store and you are not importing those as well...

One possible solution:

1. To successfully import products to the other store you have to export all related objects and then import those to new store.. To do this Choose the "Standard Download (Store Download AC7 )" option and Choose "Selected Data" export option. Now check only the following Objects:

Code: Select all

Manufacturers
TaxCodes
Warehouses
Vendors
ProductTemplates
Categories
Products
KitComponents
You can leave any of the above objects if you think this is not associated. Like You can leave ProductTemplates if no product have product templates defined.

Now as you want some selected products to copy to the other store so, the next step is to edit the XML and remove the objects you dont want to import to the other store, Like you can remove the unwanted Products, categories, Manufacturers which you dont want to import to other store...

All the product in above list are related objects and can cause foreign key errors if you try to import to other store. However you can import / export complete store data to same or other stores any time hopefully without any errors...

Post Reply