0
votes

I am using SalesForce SOAP Enterprise WSDL API in my C# application. What I came across is the need to use the SELECT query which includes REPLACE function. I tried Developer Console>>Query Editor by executing the following query, but it's giving me Unknown error parsing query error.

Following is my query that I want to execute :

SELECT Id, Name, HomePhone, MobilePhone, OtherPhone, office_phone__c.replace("-",""), phone_fax__c FROM Contact

I also tried in the following way, but that's also giving me the same error.

SELECT Id, Name, HomePhone, MobilePhone, OtherPhone, REPLACE(office_phone__c,'-',''), phone_fax__c FROM Contact

As the query implies, I want to replace "-" in my office_phone__c field with "".

Has anyone used such type of query before. I would be very grateful if anybody can lead me in the right direction.

1

1 Answers

1
votes

SOQL doesn't support functions in select clause (other than aggregates). You'll need to either create a formula field for your function and select that instead, or do the processing on the client once you've fetched the data.