Showing results for 
Search instead for 
Do you mean 

C# Phone Issue (phone contact) - object reference is not set

Copper Contributor
Posts: 12
Country: United States

C# Phone Issue (phone contact) - object reference is not set

[ Edited ]

I thought I had this solved.  I was wrong. 


When I add a contact via the SDK and then later open the lead in ACT and press the "phone contact" button, I get an "object reference is not set to an instance of an object".  Is there a seperare field I need to populate or a function I need to call or a country code to set?   I cannot figure this out.






Message Edited by toddism on 07-13-2009 11:16 AM
Tuned Listener
Posts: 1
Country: United States

Re: C# Phone Issue (phone contact) - object reference is not set

[ Edited ]

I'm having the same issue.  Here's the relevant part of my code (C#):




entry = fm.Contacts.CreateContact();

entry.FullName = args.ElementAt(0) + " " + args.ElementAt(1);
entry.Fields["TBL_CONTACT.JOBTITLE", true] = args.ElementAt(2);
entry.Fields["TBL_CONTACT.COMPANYNAME", true] = args.ElementAt(3);
entry.Fields["TBL_CONTACT.BUSINESS_LINE1", true] = args.ElementAt(4);
entry.Fields["TBL_CONTACT.BUSINESS_LINE2", true] = args.ElementAt(5);
entry.Fields["TBL_CONTACT.BUSINESS_CITY", true] = args.ElementAt(6);
entry.Fields["TBL_CONTACT.BUSINESS_STATE", true] = args.ElementAt(7);
entry.Fields["TBL_CONTACT.BUSINESS_POSTALCODE", true] = args.ElementAt(8);
entry.Fields["TBL_CONTACT.BUSINESS_PHONE", true] = args.ElementAt(9);
entry.Fields["TBL_CONTACT.FAX_PHONE", true] = args.ElementAt(10);
entry.Fields["TBL_CONTACT.BUSINESS_EMAIL", true] = args.ElementAt(11);




When I load the contact in the Act! UI, and click the "Phone Contact" button, I get two instances of the object reference is not set error, presumably for the two numbers (phone and fax) that I inserted in the above code.



Poking around a little, it appears that the nature of the problem is related to TBL_PHONE not being properly populated.  Specifically, TBL_PHONE.NUMBERVALUE and TBL_PHONE.PHONEMASKID are left as NULL, and TBL_PHONE.NUMBERDISPLAY is incorrectly formatted.  Is there a way through the API to correct this problem (or to do this correctly), or is this a bug?


Message Edited by lyndon on 08-19-2009 04:04 PM