问题
I using Salesforce (apex), i need Query that will select values from table and return them in toLowerCase.
some think like this:
//only example (not working code)
for(Users user:[select Name.toLowerCase(),LastName.toLowerCase() from Users ] )
{
//code....
}
For example if i have table Users with
Name | LastName
Boby | Testovich1
Dany | Testovich2
Ron | Testovich3
Query need to return me all values with toLowerCase:
boby testovich1,dany testovich2,ron testovich3
I can do this like this
for(Users user:[select Name,LastName from Users ] )
{
string UserName=user.Name.toLowerCase();
}
but is there a way to to this with querying?
Is there a way to do this in Salesforce (apex) Query ?
回答1:
No you can't transform the return value to lower case in the query, you'll need to do it after you've gotten the query results.
One alternative is to add a formula field that returns the lower case value and query that instead.
来源:https://stackoverflow.com/questions/39557672/salesforceapex-query-return-values-with-tolowercase