function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Inserting Accountname into Contacts


            I try to insert account name into my contact ,it is not creating the contact.How to do that?

$fields = array('type'=>'contact','LastName'=>'Inbam', 'Account_Name' =>'Mall Tech');


Ron HessRon Hess

you need to have an account already existing, then you can insert the contact into that account.

you may need two steps, one to create a new account, second to pass that account ID into the contact insert statement

I have already created the account name.The Name of the account is "Election Shopping" .

I think in the browser link every time it is passing one ID(Account Id).

I try in this manner.

$fields = array('type'=>'contact','LastName'=>"$lname", 'Account_Name' => '00130000001bUvW');


$fields = array('type'=>'contact','LastName'=>"$lname", 'AccountName' => '00130000001bUvW');


$fields = array('type'=>'contact','LastName'=>"$lname", 'Account' => '00130000001bUvW');

Nothing is working for me.

The numbers you are passing in are IDs, not names.

Try 'AccountID' => '00130000001bUvW'

I tried in different ways.But it is not working.

$fields = array('type'=>'contact','LastName'=>"$lname",'Account_ID'=>'00130000001bUvW');

$fields = array('type'=>'contact','LastName'=>"$lname",'AccountID'=>'00130000001bUvW');

$fields = array('type'=>'contact','LastName'=>"$lname",'AccountId'=>'00130000001bUvW');


My aim is to display account name in the contact.

I have tried

$fields = array('type'=>'contact','LastName'=>"$lname",'AccountName'=>'Election Shopping');


But these are not working.

Hi Adam,

The following combination is done the trick.

$fields = array ('type'=>'contact','LastName'=>"$lname",'AccountId'=>"00130000001bUvW");
I cannot get this to work either... any suggestions?

Message Edited by sideburn on 02-23-2006 02:16 AM