You need to sign in to do that
Don't have an account?
perumalvps
Replace() in soql
Hi
I have requirement to use replace() in soql query as like following code.
select Name from customobject where replace('custom_field','-','')='value'.
Any suggestions for replace() function in soql.
Thanks in Advance.
No you can't use replace in query. You need to get the proper replaced value before using it in SOQL query.
Like if I need to search account with name "ttst" and provided value is "test" then we need to do something like this :
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Hi Ankit_Arora
Thanks for your reply.
My constraint is to replace some characters of custom field which is already available in database and to compare with given string.
The solution you have provided is to how replace the input string value. But i need solution to replace database field value and to compare in SELECT query.
Regards,
S.Perumalsamy
No you can't compare two values in SOQL query directly. You need to use any field API and compare it with some value.
In your case you can create a formula field which will do all the logic and provide you the final result, and you can use that formula to compare with some value.
Thanks
Ankit Arora
Blog | Facebook | Blog Page