You need to sign in to do that
Don't have an account?
SOQL on all custom objects in sand box
Hi,
public class CustomObjectsInPickListCntrl
{
public String val {get;set;}
public void getName()
{
List<SCHEMA.SOBJECTTYPE> gd = Schema.getGlobalDescribe().Values();
List<String> customObjectList = new List<String>();
for(Schema.SObjectType f : gd)
{
Schema.DescribeSObjectResult res = f.getDescribe();
if(res.isCustom())
{
if(!res.isCustomSetting())
{
customObjectList.add(f.getDescribe().getName());
}
}
}
}
}
In the above code customObjectList has all custom objects
I have to get like this
for(SObject s : customObjectList){
List<s> slist = [Select Id LastModifiedDate from s];
}
If I wirte like this I will get SOQL Exception (100), so How I can do now. Please advice any one.
public class CustomObjectsInPickListCntrl
{
public String val {get;set;}
public void getName()
{
List<SCHEMA.SOBJECTTYPE> gd = Schema.getGlobalDescribe().Values();
List<String> customObjectList = new List<String>();
for(Schema.SObjectType f : gd)
{
Schema.DescribeSObjectResult res = f.getDescribe();
if(res.isCustom())
{
if(!res.isCustomSetting())
{
customObjectList.add(f.getDescribe().getName());
}
}
}
}
}
In the above code customObjectList has all custom objects
I have to get like this
for(SObject s : customObjectList){
List<s> slist = [Select Id LastModifiedDate from s];
}
If I wirte like this I will get SOQL Exception (100), so How I can do now. Please advice any one.
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_batch_interface.htm
Please try to not post the same question 4 times in a row.
Thanks for reply, Can you give sample code to write batch apex on this? See I have 500 objects in my sand box, I have to get latest record(using LastModifiedDate) from each object, based on this I will decide it is using from how long.