• Giacomo Dorandini
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi,

I'm trying to delete a knowledge article version record using apex, in details what I try to do is:
        string t = (string that holds the Id of the article)
        KnowledgeArticleVersion articleToRemove = [SELECT Id FROM KnowledgeArticleVersion WHERE Id = :t];
        delete articleToRemove ;


When I try to save the class I recieve the following error message:
DML operation DELETE not allowed on KnowledgeArticleVersion

Same error messagge if I use the article type insted of KnowledgeArticleVersion (FAQ__kav articleToRemove = [SELECT Id FROM FAQ__kav WHERE Id = :t])
Any suggestion? I found this in the documentation 
  • To create, update, or delete a Knowledge article version, use the call on ArticleType_kav, where ArticleType is the name of the article’s type. For example, to delete use ArticleType_kav.delete(). (see http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_knowledgearticleversion.htm)
but I don't know how to use it.
Thank you for your help.
Hi,

I'm trying to delete a knowledge article version record using apex, in details what I try to do is:
        string t = (string that holds the Id of the article)
        KnowledgeArticleVersion articleToRemove = [SELECT Id FROM KnowledgeArticleVersion WHERE Id = :t];
        delete articleToRemove ;


When I try to save the class I recieve the following error message:
DML operation DELETE not allowed on KnowledgeArticleVersion

Same error messagge if I use the article type insted of KnowledgeArticleVersion (FAQ__kav articleToRemove = [SELECT Id FROM FAQ__kav WHERE Id = :t])
Any suggestion? I found this in the documentation 
  • To create, update, or delete a Knowledge article version, use the call on ArticleType_kav, where ArticleType is the name of the article’s type. For example, to delete use ArticleType_kav.delete(). (see http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_knowledgearticleversion.htm)
but I don't know how to use it.
Thank you for your help.
Hi,

I'm trying to delete a knowledge article version record using apex, in details what I try to do is:
        string t = (string that holds the Id of the article)
        KnowledgeArticleVersion articleToRemove = [SELECT Id FROM KnowledgeArticleVersion WHERE Id = :t];
        delete articleToRemove ;


When I try to save the class I recieve the following error message:
DML operation DELETE not allowed on KnowledgeArticleVersion

Same error messagge if I use the article type insted of KnowledgeArticleVersion (FAQ__kav articleToRemove = [SELECT Id FROM FAQ__kav WHERE Id = :t])
Any suggestion? I found this in the documentation 
  • To create, update, or delete a Knowledge article version, use the call on ArticleType_kav, where ArticleType is the name of the article’s type. For example, to delete use ArticleType_kav.delete(). (see http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_knowledgearticleversion.htm)
but I don't know how to use it.
Thank you for your help.