You need to sign in to do that
Don't have an account?
Reg: Knowledge article version
Hi,
While working with KAV with the below query i got an error.
Can you please suggest me. How can i overcome this.
This is my query:
=================
List<knowledgearticleversion> lstKAV = new List<Knowledgearticleversion>();
lstKAV = [SELECT Title, Summary , PublishStatus
FROM KnowledgeArticleVersion
WHERE (PublishStatus='Online' OR PublishStatus='Draft' OR PublishStatus='Archieved')
AND Language = 'en_US'];
system.debug('****Lst of KAVS are ***'+lstKAV);
------------------------------------
Using the above i have to retrieve all Online, Draft and Archied articles.
My Error is :
=========
line 2, column 10: Implementation restriction: When querying or searching the KnowledgeArticleVersion object, you must filter using the following syntax: Id = [single ID], Id IN [list of ID's] or PublishStatus = [status]. In addition PublishStatus is only permitted in a top-level AND condition.
You can query only one PublishStatus at a time.
Hi,
Can u plz give the solution to the following questions.
1. Can we insert multiple Knowledge articles at a time using either salesforce customization or coding from system log or from apex class?
2. If it is possible list of articles insertion at a time, then how can i relate these articles to a particular case? While inserting any articlefrom system log it shows all fields which are in article is not writable? so as per my understanding, its not possible to insert bulkarticles or a single article from any apex code? is my understading correct?
3. To relate the articles to a case, i went through case related list -> articles section -> clicked on new button -> then i chosen anarticle type .................then i created a new article. Now this article created from case related list is related to that particular case. But while going with any dataloader or any list insertion from code how can we related all the list of articles to case? here i can able to see sourceid field on article, but its not useful to enter case id. Because all fields which are from articles object are not writable.?
Please give your valuable reply.
Hi,
1. You can use the API (Apex or SOAP) to create articles, you can also use the bulk API.
2. If you want to link an article to a case, you need to create a record on this object CaseArticle. CaseArticle is used to create the link between case and articles.
3. Use CaseArticle.
Hi Francoisl,
Thanks for your valueable reply.
Can you please give me a sample snippet or any URL to get the guidance for this?
Hi,
but when i enable the knowledge base, i did not get CaseArticles Object.
What are the required setps to enable this object?
Can you give the any API url to work on it?
HI,
I have created some articles from articles tab. Initially which are related to any case.
When i go with Case relatedlist -> Articles -> clicked on Find articles -> and i attached any of existing articles to case.
Now these i can see these articles in my case relatedlist to that particular case.
But when i am querying the articles based on this case id, i am getting null. It means these articles are not binded to Case id.
Can you please suggest me, how can i attach the existing articles to my case?
To attach an article to a case, you just need to create a new record of CaseArticle and specifying the requested field like:
CaseArticle ca = new CaseArticle();
ca.CaseID = caseID;
ca.KnowledgeArticleId = kaID;
insert ca;
You can also add the language and the version number.
Hi,
Iam trying to create an article from apex code and when i try to assign case id value to sourceId,iam getting the following error:
"Unable to create/update fields: SourceId".
Please provide the solution how to assign a value to sourceId field for articles.
Thank you,
Harika.
SourceId is not a createable field:
SourceId
Hi francoisL,
Thanks for your reply.
Is there any workaround to create a KnowledgeArticleVersion with "SourceId" contains case id.
Thanks,
Harika.
From API standpoint, today, there is no workaround.
But, if you use the out of the box feature (create article from a case), we are populating this field automatically.
Hi francoisl,
Thanks for your reply.
Thank you,
Harika.