Hi,
I am trying to switch a note record (Annotation entity) from one custom entity to another by changing the ObjectId and ObjectTypeCode. When I try and save the changes I get the following error;
"Invalid type for entity id value"
I have made sure the id and type code are correct for the new entity. is there anything wrong with this code?
foreach (var entity in returnValues.EntityCollection.Entities)
{
var note = (Annotation) entity;
//Just remove Key field of annotation
note.AnnotationId = null;
//Replace referencing object with destination object
note.ObjectId = new EntityReference(destEntity.LogicalName, destEntity.Id);
note.ObjectTypeCode = destObjectTypeCode.ToString();
//And Create the annotation record
service.Create(note);
}
*This post is locked for comments
I have the same question (0)