You need to sign in to do that
Don't have an account?

Test class for a dynamic query
Hi Guys,
I want to write a test class for a controller class having dynamic query.please give examples....
Eg-
query = 'SELECT id' + ',' + fields +'FROM'+ objectName + 'WHERE' + queyCondition '=accId';
sObjectList = Database.query(query);
Thanks,
Abhilash
I want to write a test class for a controller class having dynamic query.please give examples....
Eg-
query = 'SELECT id' + ',' + fields +'FROM'+ objectName + 'WHERE' + queyCondition '=accId';
sObjectList = Database.query(query);
Thanks,
Abhilash
By the way you just need to create your test data and call your controller method. There is nothing special required for this dynamic query. If this answer solves your problem then mark it as the solution to help others. Thanks.