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
Jerun JoseJerun Jose 

Alphabet search for special characters

Hi,

 

I'm trying to simulate the alphabet search functionality available in standard list views. I have been able to get most of the work done by using an SOQL query with filters for field1 like '%A'

 

 

But I do not know how to work the 'Other' filter on the alphabet search. This filter will present you all the records that start with a number or special character. How can we issue a SOQL query which does something similar?

Best Answer chosen by Admin (Salesforce Developers) 
Gunners_23Gunners_23

Following Query will get you the records which starts with numbers on the similar ground may be you can extend it for special

 

Characters.

 

SELECT Name FROM Account WHERE Name >= '0' AND Name <= '9'

 

 

All Answers

Gunners_23Gunners_23

Following Query will get you the records which starts with numbers on the similar ground may be you can extend it for special

 

Characters.

 

SELECT Name FROM Account WHERE Name >= '0' AND Name <= '9'

 

 

This was selected as the best answer
Jerun JoseJerun Jose
Thanks. Your suggestion worked perfectly. Just to add, number query also needed a Name like '%9' or condition to it.