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
eddieeddie 

Contact Field Problem

Hello,

I am trying to create a new contact with the insert method

When I run this code:

object[] ret;

mapEntry[] record = new mapEntry[6];

//Create new mapentries and set the values for each field

record[0] = new mapEntry();

record[0].key = "firstName";

record[0].value = fname;

record[1] = new mapEntry();

record[1].key = "lastName";

record[1].value = lname;

record[2] = new mapEntry();

record[2].key = "Phone";

record[2].value = phone;

record[3] = new mapEntry();

record[3].key = "Fax";

record[3].value = fax;

record[4] = new mapEntry();

record[4].key = "Email";

record[4].value = email;

record[5] = new mapEntry();

record[5].key = "accountID";

record[5].value = accounttid;

ret = (object[]) sforce.insert("contact", record);

 

I get this error message:

Fault Code: 0

Fault string: bad field names on insert/update call: Email, Fax, Phone

 

I ran a describe on "Contact" and found that most of the fields were not accepted by insert.

Where can i find a list of valid fields to use in code.

Thankyou,

GL

DevAngelDevAngel

Hi eddie,

Looks like 2.0 code to me.  Not the best decision when using .Net.  You should seriously consider using the 3.0 api.

The field names in 2.0 are case sensitive, so Email should be email etc.