How to set a Lookup value in CRM 2011 with SSIS 2008 ( Framework 3.5)
-
Tuesday, April 24, 2012 7:12 AMI tried this way and its does not work
I tried this way and its does not work :
account.parentaccountid= new Lookup ();
account.parentaccountid.type = EntityName.account.ToString();
account.parentaccountid.Value = _accountId;
Thanks,
All Replies
-
Tuesday, April 24, 2012 7:19 AM
Hi it has changed for CRM 2011,
you need to pass like this way
account.parentaccountid= new EntityReference("account", _accountId);
By Sanz. -- If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
- Proposed As Answer by san Sanz Tuesday, April 24, 2012 7:19 AM
-
Tuesday, April 24, 2012 7:24 AMYes but he refuses EntityReference, it tells me it is impossible to convert a Lookupin EntityReference.
-
Tuesday, April 24, 2012 7:25 AM
im sorry who refused?
you need add the new sdk dlls and it should be .net framework4.0
By Sanz. -- If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
-
Tuesday, April 24, 2012 7:29 AMI also tried with. Net Framework 4.0 but the error is the same: In his definition is of type Lookup parentaccountid and he accepts nothing outside (new Lookup () ;) how to change that ?
-
Tuesday, April 24, 2012 7:34 AM
this might be the problem of using CRM 4.0 Class code,please generate the cs file using crmsvcutil.exe
By Sanz. -- If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
-
Tuesday, April 24, 2012 7:49 AM
What is the syntax to generate the cs file in the command prompt please. -
Tuesday, April 24, 2012 8:13 AM
if you are running on crm machine you no need to pass authentication
CrmSvcUtil.exe /out:Xrm.cs /url:http://localhost/organizationName/XRMServices/2011/Organization.svc /namespace:Xrm /u:username /d:domain /p:password
http://msdn.microsoft.com/en-us/library/ff681563.aspx
By Sanz. -- If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
- Edited by san Sanz Tuesday, April 24, 2012 8:15 AM