Forum Discussion
Looking at your code, the SQL statement doesn't look correct
Salesforce.Query("SELECT+Id+from+Account+WHERE+Name+=+'" + AccountName + "'");
I suggest you try something like this,
"SELECT Id FROM Account WHERE Name = 'Sandy'"
See https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm for more details.
- Rmuenks12 years agoOccasional Contributor
Hi rraghvani!
Thanks, I was following the SOQL query format which was provided in the Examples provided with the github Salesforce / TestComplete extension which had this listed:
// JavaScript example
function Get_Names()
{
let names = Salesforce.Query("SELECT+Name+FROM+Account");
for (let i = 0; i < names.Count(); i++)
{
Log.Message(names.GetItem(i).Name);
}
}I did try your suggestion however, and still got the error.
Status Code: 400
Status Text: Bad Request
Body:
[{"message":"Account: bad field names on insert/update call: Additional_E_mail__pc, Special_Needs__pc, Custom_Permissions__pc, Lic_Designation__pc, FinServ__ReferredByUser__pc, FinServ__CommunicationPreferences__pc, FinServ__ContactPreference__pc, Business_Phone__pc, Events_Experiences__pc, NAM_ID__pc, Formal_First_Name__pc, FinServ__CustomerTimezone__pc, Flag_for_Deletion__pc,- rraghvani2 years ago
Champion Level 3
I'm not using the + symbol in the SQL statement, and SOQL query examples also doesn't use it.
- Rmuenks12 years agoOccasional Contributor
Ok, I will remove them.
If someone knows how to resolve the error for "bad field names on insert/update call:" or how to remove the Person Contact fields from the object I would appreciate it.