How to insert custom field values in civicrm?

834 Views Asked by At

Hello friends I created some custom fields for contacts. How can I insert values to that custom fields. I tried to pass the custom values with params. but its not inserting. how to insert that values. Kindly help me.

1

There are 1 best solutions below

0
On BEST ANSWER

// Define input parms for the contact and initial primary location

$params = array(
                'first_name'    => 'Dan',
                'custom_{put your custom filed id here}' => "custom field value1",
                'custom_{put your custom filed id here}' => "custom field value2"
                );
$contact =&civicrm_contact_create( $params );
print_r($contact);

Like this way we can insert value to custom fields