I have some code originally written for CRM 4 then moved to CRM 2011 UR 6 that creates a custom activity (printcard). The code creates the activity and assigns the owner to be a team. This has worked great until we upgraded to UR 18. We now get an error
of invalid owner type id. I've tried changing the code to LINQ, but get the same results. I've tried setting the owningteam lookup, but it's set to the systemuser instead. The guid is a valid team guid. Ideas on what's causing the issue?
BusinessObjects.CRMSdk.xxx_printcard printCard = new BusinessObjects.CRMSdk.xxx_printcard();
// Set up the CRM Service.
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
// Create an authentication token for your organization.
BusinessObjects.CRMSdk.CrmAuthenticationToken token = new BusinessObjects.CRMSdk.CrmAuthenticationToken();
token.OrganizationName = OrgName;
// Use Active Directory authentication.
token.AuthenticationType = 0;
service.CrmAuthenticationTokenValue = token;
service.Url = CRMUrl;
printCard.xxx_actor = new Lookup();
printCard.xxx_actor.Value = ActorID;
printCard.xxx_actor.type = EntityName.contact.ToString();
printCard.subject = ActivitySubject;
printCard.regardingobjectid = new Lookup();
printCard.regardingobjectid.Value = ActorID;
printCard.regardingobjectid.type = EntityName.contact.ToString();
DateTime DueDate = DateTime.Now.AddDays(3);
printCard.scheduledend = new CrmDateTime();
printCard.scheduledend.Value = DueDate.ToString();
printCard.xxx_cardtype = new Picklist();
printCard.xxx_cardtype.Value = 100000000;
printCard.ownerid = new Owner();
printCard.ownerid.Value = TeamID;
printCard.ownerid.type = EntityName.team.ToString();
printCard.xxx_batchid = new Lookup();
printCard.xxx_batchid.Value = BatchID;
printCard.xxx_batchid.type = EntityName.xxx_printcardbatch.ToString();
printCard.xxx_actorpaidtodate = new CrmDateTime();
printCard.xxx_actorpaidtodate.Value = PaidThruDate.ToString();
TargetCreatexxx_printcard target = new TargetCreatexxx_printcard();
target.xxx_printcard = printCard;
CreateRequest createRequest = new CreateRequest();
createRequest.Target = target;