function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
tukmoltukmol 

Batch Apex and Knowledge Article

Hi, is it not possible to batch knowledge article object?

 

See this batchacble class for example, this gives internal salesforce.com error whenever i try to run this.

 

public class EnumerateExpiredArticles
	implements database.Batchable<sobject> {
    public Database.QueryLocator start(Database.BatchableContext BC) {
    	// Access initialState here         	
    	return Database.getQueryLocator([SELECT  Title, Summary, OwnerId FROM Knowledge_Article__kav WHERE PublishStatus = 'Online' AND Language = 'en_US' AND LastPublishedDate = LAST_N_DAYS:180]);
  	}

  	public void execute(Database.BatchableContext BC,  List<sObject> batch) {
  		for (Knowledge_Article__kav ka : (List<Knowledge_Article__kav>) batch) {
  			//send notification to owner
  		}    	
    }

  	public void finish(Database.BatchableContext BC) {
  		   
	}		
}

But if replace the object with something else (i.e. case, account, etc), it goes fine.

 

any help?

 

thanks

francoisLfrancoisL

Hi,

 

Did you try this code with Spring'13 or Summer'13? Because it should work in summer'13.

 

tukmoltukmol

Spring 13 is where i've encountered the error. Will try to get hold of our Summer 13 sandbox.

 

Thanks

 

tukmoltukmol

Unfortunately, it gives the same error in Summer 13: "Internal Salesforce.com" error.