Hi All ,
Using Odata , I am trying to create Distinct Product ,and using the below code for same :
Microsoft.Dynamics.DataEntities.DistinctProduct product = new DistinctProduct();
DataServiceCollection<DistinctProduct> prod = new DataServiceCollection<DistinctProduct>(context);
prod.Add(product);
product.ProductNumber = Prod;
product.ProductName = Prod;
product.StorageDimensionGroupName = "Site";
product.TrackingDimensionGroupName = "None";
product.ProductType = EcoResProductType.Item;
Microsoft.Dynamics.DataEntities.ReleasedDistinctProduct dpr = new ReleasedDistinctProduct();
DataServiceCollection<ReleasedDistinctProduct> releasedProd = new DataServiceCollection<ReleasedDistinctProduct>(context);
releasedProd.Add(dpr);
dpr.ProductNumber = Prod;
dpr.ItemNumber = Prod;
dpr.DataAreaId = "usmf";
dpr.ItemModelGroupId = "FIFO";
dpr.ProductGroupId = "Audio";
dpr.ProductionType = PmfProductType.None;
context.SaveChanges(SaveChangesOptions.PostOnlySetProperties);
I am getting the error :
message":"An error has occurred.","innererror":{
"message":"Write failed for table row of type 'EcoResReleasedDistinctProductEntity'. Infolog: Warning: Field 'Language' must be filled in.; Warning: You must enter a translation for the product to save the record.; Warning: validateWrite failed on data source 'EcoResProductTranslation (EcoResProductTranslation)'.","type":"Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataWriteException","stacktrace":"
Can someone please help me,what I am missing here.
Thanks,
Gaurav PAndey