I am having an issue with the database.Query. I keep getting a I think error on of my object variable doesn't exist or my where clause is incorrect. This is what I tried
String strObjectName = soOrder.Record_Name__c; String strName = soOrder.Record_id__c; 1.) List<sObject> lstOrder = Database.query('SELECT Id FROM strObjectName WHERE Name = :strName'); 2.) string strQuery = 'Select Id From ' + strObjectName + ' where Name =: ' + strName; List<sObject> lstOrder = Database.query(strQuery);
I am getting an error on the where clause in which when the database.Query fires it wants single quotes around it.