2

is it possible to do SOQL for the unknown object without for loop as below

string theQuery = 'Select '+fiels+' From'+obj_frm +whr; Map <Id, object> oppMap = new Map<Id, object>((List<object>)Database.query(theQuery));

0

1 Answer 1

3

You need to use SObject as the value, not Object.

Map<Id, SObject> opportunities = new Map<Id, SObject>(Database.query(...));
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .