You need to sign in to do that
Don't have an account?
NewBie09
build dynamic soql condition based on Datatypes
I need to build a soql condtion dynamically,
E.g. if datatype is EMAIL then all same datatypes should be in OR condtion and other datatypes in AND condtion
WHERE (email='test@gmail.com' OR email='test_1@gmail.com') AND (name='test' OR name='test_1')
and return it to a string
E.g. if datatype is EMAIL then all same datatypes should be in OR condtion and other datatypes in AND condtion
WHERE (email='test@gmail.com' OR email='test_1@gmail.com') AND (name='test' OR name='test_1')
and return it to a string
Best Answer chosen by NewBie09
Asif Ali M
Try the below code to capture the Object fields by Type and use the Map(fieldsByType) to build SOQL dynamically. Curently this code captures the Account fields. You can change the code as per your need. I Hope you can now build the SOQL dynamically.