• SofitDevelopment
  • 0 Points
  • Member since 2012

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 3

I'm trying to use this method in a dynamic SOQL query. Follow the sample code:


public static String getRowById(String sobjName, id id){
	String query = 'select ';            
	Map<String, Schema.SObjectField> objectFields = Schema.getGlobalDescribe().get(sobjName).getDescribe().fields.getMap();
	for(String f : objectFields.keySet()){
		query += f;
		query += ',';
	query = query.substring(0,query.length()-1);
	query += ' from '+ sobjName;
	query += ' where id = \'' + String.escapeSingleQuotes(id) + '\'';
	query += ' limit 1';
	return query;


The problem is that this is still considered as a SOQL Injection vulnerability.

Am I missing something here? I also tried to use it as a parameter like this:






We have designed our application to process large amount of data using Batch Apex.

We are creating 5 parallel jobs for the batch created to perform the execution, the whole idea is to improve the performance of the app.

During execution, under Monitoring -> ApexJobs, we find the below exception:


First error: java.sql.SQLException: ORA-00001: unique constraint (CORE.AKCRON_JOB_DETAIL) violated
ORA-06512: at "HAPPY.CCRONJOBDETAIL", line 84
ORA-06512: at line 1
: {call cCronJobDetail.insert_detail(?,?,?,?,?,?,?,?,?)}


We are scheduling the jobs in the finish method of the Batch created. 

Is this error thrown because of the cron creation done across parallel jobs, where we see a race condition ?

Please let us know if there are any pointers where we could avoid the above error which we dont have a control on. Rather we could make the cron creation synchronous, if there is a way.

Thank You.



I am getting the following error trying to save/compile an apex class which is managed beta (not yet released):


Managed type that is released without a supertype can not subsequently extend another type


Why am i getting this error on the BaseExtObject class below if i have the following classes and interfaces defined:



global virtual interface ObjectAInterface {...}
global virtual interface ObjectBInterface {...}
global virtual interface ObjectCInterface {...}
global virtual class BaseObject implements ObjectAInterface, ObjectBInterface, ObjectCInterface {…}
global virtual class BaseExtObject extends BaseObject {…}



  • February 08, 2011
  • Like
  • 0