Community
Showing results for 
Search instead for 
Do you mean 
Reply

Writing to user created fields

New Member
Posts: 2
Country: United_Kingdom

Writing to user created fields

Would someone mind helping a noob out.

 

I'm trying to write a .NET integration application in C# to take some data from a web site and write directly to the Contact table, all was going well, I can create the contact record if required, can write to the built in fields but for the life of me I can't figure out how to write to a user defined field. eg

 

I have a field that I created with a display name of "Division", if I go hacking around the contact table I find that field is actually called CUST_Division_091958556, what I would like to do is write to this field using code something like this.

 

.....

strFieldName = "TBL_CONTACT.CUST_Division_091958556";

oContact.Fields[strFieldName, true] = "Test";

.....

 

What I would like to do is determine the field name programatically, can anyone help me with a line or two of code to point me in the right direction?

 

TIA

Employee
Posts: 1,163
Country: USA

Re: Writing to user created fields

Hello Andy,

 

Fortunately we can retrieve custom fields via their display name and we don't need to go 'hacking' through SQL to find it =)

 

ContactFieldDescriptor cfd = 
                ActApp.ActFramework.Contacts.GetContactFieldDescriptor("Contact.SDK TEST"false);

In some cases, depending upon how many custom fields you have, you may run into cases where it is unable to find the specified column name, in these scenarios you may have to replace the table name with Contact Table 1, as the data may be in a spill over table.

 

HTH

Matthew Wood
Act! SDK Support
Community Moderator
New Member
Posts: 2
Country: United_Kingdom

Re: Writing to user created fields

Thanks Mathew. I knew there must be a way but I was working a wee bit late last night and I kept staring at the SDK documentation and scratching my head until 3 am, getting more and more frustrated and understanding less and less as you do when you do daft things like that.

 

ps Your timing was perfect, I'd just decided to give the guys in Newcastle a call when you posted.