I am doing a migration job. I have an xml with data and i am importing it to Catalog.
On some items i get following error:
Any idea to why?
2019-07-04T04:54:58,Error,ktms03mstrqx112prep,ab7fea,636978128988831035,0,8452,203,"KTM.Integrations.PIM.EPi.ScheduledJobs.PimXmlAzureImportJobMaster : Column 'IsPrimary' does not allow nulls.
System.Data.NoNullAllowedException: Column 'IsPrimary' does not allow nulls.
at System.Data.DataColumn.CheckNullable(DataRow row)
at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)
at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Boolean suppressEnsurePropertyChanged, Int32 position, Boolean fireEvent, Exception& deferredException)
at System.Data.DataTable.InsertRow(DataRow row, Int64 proposedID, Int32 pos, Boolean fireEvent)
at KTM.Integrations.PIM.EPi.Data.Parsers.CommerceParserBase.CreateUpdateRelation(Int32 catalogId, Int32 nodeId, Int32 entryId, Int32 sortOrder)
at KTM.Integrations.PIM.EPi.Data.Parsers.StructureParser.ParseProduct(String code, String parent, CatalogType type, TextElementCollectionDescriptor texts)
at KTM.Integrations.PIM.EPi.Data.Parsers.StructureParser.Parse()
at KTM.Integrations.PIM.EPi.Data.Parsers.DataParser.TryRun(Action action, Action`1 errorAction)",80000149-0002-fe00-b63f-84710c7967bb
****** CODE *****
protected CatalogRelationDto.NodeEntryRelationRow CreateUpdateRelation(int catalogId, int nodeId, int entryId, int sortOrder)
{
var relationDto = GetRelationDto(catalogId, nodeId, entryId);
CatalogRelationDto.NodeEntryRelationRow relation = null;
foreach (var entryRelation in relationDto.NodeEntryRelation.ToList<CatalogRelationDto.NodeEntryRelationRow>())
{
if (entryRelation.CatalogEntryId.Equals(entryId) &&
entryRelation.CatalogNodeId.Equals(nodeId))
{
relation = entryRelation;
continue;
}
relationDto.NodeEntryRelation.RemoveNodeEntryRelationRow(entryRelation);
}
if (relation == null)
{
relation = relationDto.NodeEntryRelation.NewNodeEntryRelationRow();
relation.CatalogId = catalogId;
relation.CatalogNodeId = nodeId;
relation.CatalogEntryId = entryId;
}
relation.SortOrder = sortOrder;
if (relation.RowState.Equals(DataRowState.Detached))
{
relationDto.NodeEntryRelation.AddNodeEntryRelationRow(relation);
}
else
{
relation.AcceptChanges();
}
if (relationDto.HasChanges())
{
_catalogSystem.SaveCatalogRelationDto(relationDto);
}
return relation;
}