Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 55831

Object reference not set to an instance of an object.

$
0
0

Dear All,

I'm trying to insert couple of records for Entity person 

here is the code I wrote:

Entity account  = new Entity("contact");

            account.Attributes["firstname"] = "Test";

            account.Attributes["lastname"] = "Test";

            account.Attributes["datatel_prospectsourceid"] = "Beacardinal Website";

            account.Attributes["preferredcontactmethodcode"] = new OptionSetValue(2);

            account.Attributes["address1_telephone1"] = "3333333333";

But I keep getting this error message: "Object reference not set to an instance of an object." .

Any suggestions?

Regards


Viewing all articles
Browse latest Browse all 55831

Trending Articles