Salesforce Developer Soql Dynamic Query

salesforce-developer-soql

String query = 'SELECT Id, field1, field2 FROM sObjectName WHERE Id = :processId';

sObject o = database.query(query);
if(o != NULL){
    reason = o.get('field1') + '';
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License