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
mikeolmikeol 

Invalid field error on lookup field to custom object

I guess I must be doing something dumb here, I expect I need to some help seeing the obvious.

I have a custom object (Direct_Payment).  On the Account record I have added a custom field which is a simple lookup reference to the custom object.

I can see the custom field on the Account record when I log on to Salesforce, I can export it using Sforce Data Loader and can also extract it to a spreadsheet using the ever trusty Sforce Connector.  But when I try to query it with AJAX:
    Select Name, Direct_Payment__c, Account_No__c FROM Account Where Id = 'xxxx'
then I get the dreaded "INVALID FIELD", "No such column 'Direct_Payment__c' on entity 'Account'.  Error at Row:1 Column: 14.  Note the SQL statement is the same one which works successfully in Sforce Data Loader.

I'm using Beta 3.3 of the AJAX interface and the same salesforce logon in all cases.

Thanks.

Since discovered that the logon determines the endpoint.  I need to use 7.0 to get to lookup fields:

sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_70}"); not
sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_60}");

Problems solved by me!

Message Edited by mikeol on 10-08-2006 06:15 PM