+ Start a Discussion
aqeel ahmadaqeel ahmad 

Different field have different data type so what should i do?

 if(field == 'StageName')
        soql = 'Select' + ' '+field +' '+',Amount from Opportunity where ' + field +Operator+'\''+Val+'\'';
 if(field == 'Amount')
        soql += val;
        runQuery();
       since amount is integer field and stage is string type so how to manage the query?
Harish RamachandruniHarish Ramachandruni
Hi,

use this to get data type 

write logic for that .
Schema.DisplayType dt = Schema.sObjectType.Account.fields.AnnualRevenue.getType();


replace account palce to sobject and replace annual revenue place uour selectd field .

Regards,
Harish.R.