[Vtigercrm-developers] Creating Contacts with custom field data

Joe lists at joefleming.net
Thu Apr 9 10:46:28 PDT 2009


Hey all,

I just started using vTiger and I'm overall pretty impressed with the
package. Of course, it's not perfectly suited for my needs out of the
box so I needed to add some of my own code to it.

One of the things we need to do is import clients who have placed orders
through our website as Contacts. I've been using the SOAP interface to
handle the email optout stuff so I thought I'd also use it to create
these new Contacts.

Everything works fine, except for custom field values. I have a custom
field, which is a checkbox named "Agent", that needs to be checked if
the client is indeed an agent. The problem is, I can't seem to pass the
value with $focus->column_fields['agent'] as I expected. I CAN, however,
look up the custom field column name (cf_535 in this case) and assign it
with $focus->column_fields['cf_535'].

This isn't ideal because I'm using the same code in a test environment
(or several, actually) that have different cf ids for the same fields
(cf_535 on this machine, cf_463 on anther, cf_398 on another, etc). Is
there a way I can set the value by calling it by name (agent) instead of
by it's custom field name (cf_535)? For the record, I'm currently using
the first test build of 5.1.0. Any help is appreciated!

Also, what is the preferred resource for learning how to use the
different module classes? I've just been figuring it out by looking at
existing code, which is kind of a slow way to learn...

-Joe



More information about the vtigercrm-developers mailing list