cannot be converted from original type 'System.Int64' to target type 'Microsoft.Xrm.Sdk.OptionSetValue'

351 views Asked by At

When importing data of product table to dynamics 365 using data factory, I am getting this error:

{
    "errorCode": "2200",
    "message": "Failure happened on 'Sink' side. ErrorCode=UserErrorTypeConversionFail,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=The attribute 'statecode' with value '0' cannot be converted from original type 'System.Int64' to target type 'Microsoft.Xrm.Sdk.OptionSetValue'.,Source=Microsoft.DataTransfer.ClientLibrary.DynamicsPlugin,''Type=System.InvalidCastException,Message=Specified cast is not valid.,Source=Microsoft.DataTransfer.ClientLibrary.DynamicsPlugin,'",
    "failureType": "UserError",
    "target": "Copy data1",
    "details": [] }

This is for the field 'statecode' of which all values are set to 0 so that the status of the products being imported is active. I have not been able to find a fix for this error.

1

There are 1 answers

0
Anant Rai On

The issue got resolved. It was because I was importing data to Produkt (German name for Product) and my user interface language was English. I changed the language to German which is also the base language and changed the table name to Product. This solved my problem.