My class code:
public class KnowledgeController {
public static KnowledgeController getInstance(){
KnowledgeController instance = new KnowledgeController();
return instance;
}
private void KnowledgeController() {
}
public void validaArquivamento(){
Date todaysDate = system.today();
List<Solucoes__kav> lstKnowledge = [SELECT Id,
ArchivedDate,
BR_PrevisaoArquivamento__c,
PublishStatus
FROM Solucoes__kav
WHERE PublishStatus = 'Online' and BR_PrevisaoArquivamento__c =: todaysDate];
if(lstKnowledge.size() > 0){
for(Solucoes__kav knowledge : lstKnowledge){
knowledge.PublishStatus = 'Archived';
knowledge.ArchivedDate = todaysDate;
update knowledge;
}
}
}
}
1 Antwort
Hi,
Have a look on relevant article.
Update Knowledge base articles with Data Loader
https://help.salesforce.com/HTViewSolution?id=000233637
It's not possible to update an article's PublishStatus via the Data Loader and it's necessary edit each article you would like to update to create a draft version.