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
MajidPkMajidPk 

Failed to execute query succesfully, error message was: MALFORMED_QUERY

Hey,

 

I am having this error, while trying to create a custom object via api in my C# salesforce applications. Plz help



Failed to execute query succesfully, error message was: MALFORMED_QUERY: Billed_Out_Invoices__c where Account__c=2500 Invoice_Amount__c=2500 ^ ERROR at Row:1:Column:107 unexpected token: 'Invoice_Amount__c'

 

I am not sure what's going wrong.

 

Here is how i am creating the object.

 

 Billed_out = new sforce.sObject();                   

System.Xml.XmlElement[] acct = new System.Xml.XmlElement[5];                   

System.Xml.XmlDocument doc = new System.Xml.XmlDocument();

 

acct[0] = doc.CreateElement("Account__c"); acct[0].InnerText = "12345";                   

acct[1] = doc.CreateElement("DA_Link__c"); acct[1].InnerText = "http://www.yahoo.com";                   

acct[2] = doc.CreateElement("Invoice_Amount__c"); acct[2].InnerText = "23.34";                   

acct[4] = doc.CreateElement("Name"); acct[4].InnerText = "Hello salesforce";                   

acct[3] = doc.CreateElement("Invoice_Date__c"); acct[3].InnerText = DateTime.Now.ToString("yyyy-MM-ddThh:mm:ss-00:00");

Billed_out.type = "Billed_Out_Invoices__c";                   

Billed_out.Any = acct;

Ray DehlerRay Dehler

There's not enough context to help here.  Specifically, the error message mentions 2500, where does that come from?  It's not in your sample code...

MajidPkMajidPk

Thanks for the reply Ray.

 

I have fixed the issue BTW.

 

There wasn't anything wrong with this query, infact there was another select query before this one, which was causing this error to be thrown.

 

Thanks, once again

 

Majid