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
pathworkspathworks 

Error updating a custom field on Lead using Partner API

I seem to be a bit inept today, so I'm sure I'm doing something wrong.  But...when I try to update a custom field on Lead using the Partner API (now that I'm using the correct endpoint), I get an error that the field does not exist.
 
"common.exception.ApiQueryException: No such column 'AMBI_Pathworks_ID' on entity 'lead'."
 
However, if I go to the Setup->Customize->Lead->Fields screen, I can see that there is a custom field of type text, with that exact name = AMBI_Pathworks_ID.
 
Here's my code, which is pretty straightforward.  Do I have some sort of namespace problem?  I think this is exactly like a sample I found.
 
                 MessageElement [] updateFields = new MessageElement[1];
                 updateFields[0] = new MessageElement(new QName("AMBI_Pathworks_ID"), newTask.getId());
                 SObject leadUpdate = new SObject(type, new String [] {}, id, updateFields);
                 binding.update(new SObject [] {leadUpdate});
Thanks again for the help,
Dan
pathworkspathworks

 

Managed to figure this one out myself.  Append __c to the end of the field name and it works.

 

Dan

 

SuperfellSuperfell
AppExhange explorer is great for flushing out these kinds of problems.