How to create a new knowledgearticle object from Apex code in salesforce? Using the insert statement with a knowledgearticle shows a DML operation INSERT not allowed on KnowledgeArticleVersion error.
Also, if there is an already exisiting article…how to update the article .. For e.g. add some more text to the summary of the knowledge artilcle.
Best Answer
I know that it was a few years ago, but here is my code snippet for future usage. I used publishArticle(articleId, flagAsNew) and editOnlineArticle(articleId, unpublish).
You can find more details on my blog here.
Usage example: