Hi
After setting the field length to max values in DCRM also,customer is still facing the same exception.Except for a filed,we're not setting field length restrictions in code.
Code follows:
public String StoreUnpublishedData(String entityName,String messageName,String data,String listener,String failedInfo)
{
try
{
String failedInfo2 = String.IsNullOrWhiteSpace(failedInfo) ? "" : failedInfo;
if (failedInfo2.Length > 4000)//in case it is too long
failedInfo2 = failedInfo2.Substring(0, 4000);
Entity LogEntity = new Entity();
LogEntity.LogicalName = "unpublisheddata";
LogEntity.Attributes.Add("id",Guid.NewGuid().ToString().Replace("-", ""));
LogEntity.Attributes.Add("messageName",messageName);
LogEntity.Attributes.Add("entityname",entityName);
LogEntity.Attributes.Add("Listener", listener);
LogEntity.Attributes.Add("Retries", 0);
LogEntity.Attributes.Add("failedInfo",failedInfo2);
LogEntity.Attributes.Add("data", data);
m_ctx.OrganizationService.Create(LogEntity);
return newId;
}
catch (Exception)
{
throw;
}
}
line m_ctx.OrganizationService.Create(LogEntity) is throwing exception.
Fields length in DCRM:
Column Name Max Length
entityname 100
messagename 100
id 100
failed_info 4000
data 102400
listener 10240