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
Yuriy KovarskiyYuriy Kovarskiy 

Query API call problem

I try to use a query API call that looks as follows:

select Id from Account where InstitutionType__c = <value>

The problem (Malformed query error) occurs when value = Doctor's Office because it contains a single quote.

InstitutionType__c is a custom field that we added to Account entity.

How can I fix this query? 

Thanks,

Yuriy Kovarskiy

SuperfellSuperfell
You need to escape the ' with a \, see the SOQL docs.
gudduguddu
hello Yuriy,
You have written that you have added custom field to Account.
I also have to add custom field to account and lead . I am using Sforce 6.0 API and asp.net using c#. Can u guide me how can i add this ?
i am using partner WSDL.

Thanks