Hey guys,

Im having a lot of issues with Picklists in CRM 3.0 and was wondering
if anybody could help me out.

I have a C# app that is populating a bunch of accounts into CRM 3.0.

In my c# app i have a dataview and am looping through the dataview
items and generating accounts in CRM using CRM's WebServices.

(example code)
.....begin loop.....
account theAccount= new account();

theAccount.name =
dvTheCompanies[x].Row[1].ToString();
theAccount.new_firstname =
dvTheCompanies[x].Row[2].ToString();
theAccount.new_lastname =
dvTheCompanies[x].Row[3].ToString();
theAccount.new_jobtitle =
dvTheCompanies[x].Row[4].ToString();

theAccount.new_tsgteamassignment.name =
dvTheCompanies[x].Row[5].ToString(); //this fails here

Guid theAccountID = crmService.Create(theAccount);
....end loop....

debugging through my code everything works fine except the picklist,
which errors out with "Object reference not set to an instance of an
object."

so i tried theAccount.new_tsgteamassignment.Value = 2 but i get the
same error. My question is how do i create an account enitity in CRM
3.0 and populate the picklists inside that enitity?

Thanks for your help!

Re: Picklists in CRM 3.0 by Dan

Dan
Wed Mar 29 00:41:42 CST 2006

Okay after a little more trial and error i got it working but i dont
like the solution.

Picklist clientTypepl = new Picklist();
clientTypepl.name = "Contract Client";
clientTypepl.Value = 3;

theAccount.new_tsgteamassignment = clientTypepl ;

Is this the only / best way to populate picklists using CRM's
Webservices.

Thanks again!