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
Kemp100Kemp100 

Add to lookup field

I am trying to add a value to a LOOKUP field from a API. It for some reason wont add the value
 
the LOOKUP field is holding a name so i'm supplying it "first last"
 
am i doing anything wrong? the syntax is correct.
avinashavinash
yes I am also facing this issue. I need to enter the account name into a case. The account name  is a lookup field.This is not working using NUSOAP.
vivi

I am having the same problem. I have added a lookup field to the Account object called Region. This is a lookup to another Cutom object/table Regions.

In .NET if I view the sforce object in the Object browser I see Region__c() as string and Region__r() as Sforce.Region__c

If I do a query through the API with query string "SELECT Region__c From Account" I get the Id for a given region from the Regions object/table.

If I do an update setting Region__c equal to the Id for a different region, it does not update.

Also, If I do a query through the API with the query string "SELECT Region__c, Region__r FROM Account" I get an error stating Region__r does not exist.

Do I need to set Region__c and Region_r when updating?

For other custom fields, when updating through the API, I have found that I have to set CustomField__c to the desired value and set CustomField__cSpecfied = "True" for the update to take place.

vivi
Disregard previous post by vi , Region__c is being updated correctly buy just updating Region_c.
 
 
SuperfellSuperfell
The type of the lookup field is an ID (aka foreign key), you need to supply the Id of the account you're trying to reference, not its name.