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
CloudPower1CloudPower1 

Can we create Knowledge articles in Salesforce using Apex code?

Hi,

Can we create Knowledge articles programatically using Apex code in salesforce?
Best Answer chosen by CloudPower1
ShashForceShashForce
Hi,

Yes you can create an Article using API.

Some documentation:
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_knowledgearticleversion.htm

Basically, 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.

Also, we have more advanced API action available in Apex and REST API to publish, archive, ...
More info here:
http://www.salesforce.com/us/developer/docs/knowledge_dev/index_Left.htm#StartTopic=Content/apex_classes_knowledge_kbManagement.htm

If this answers your question, please mark this as the Best Answer for this post, so that others can benefit from this post.

Thanks,
Shashank

All Answers

kiranmutturukiranmutturu
http://www.salesforce.com/us/developer/docs/knowledge_dev/salesforce_knowledge_dev_guide.pdf
ShashForceShashForce
Hi,

Yes you can create an Article using API.

Some documentation:
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_knowledgearticleversion.htm

Basically, 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.

Also, we have more advanced API action available in Apex and REST API to publish, archive, ...
More info here:
http://www.salesforce.com/us/developer/docs/knowledge_dev/index_Left.htm#StartTopic=Content/apex_classes_knowledge_kbManagement.htm

If this answers your question, please mark this as the Best Answer for this post, so that others can benefit from this post.

Thanks,
Shashank
This was selected as the best answer
CloudPower1CloudPower1
Thanks Shashank... the link helped.
Title and URLName fields are amndatory fields to be added.
Sachin Kumar 255Sachin Kumar 255
Hi Shashank,

Is it possible to insert article in knowledge__kav object through bulk api while keeping article status as "publoshed".
It allows me to keep status as Draft but not published.

Amy suggestions please.

Thanks,
Sachin