You need to sign in to do that
Don't have an account?
knowledge:articleCaseToolbar not rendering Attach to Case buttons
I am setting up custom VF templates to display our SF Knowledge articles. I have included the VF component knowledge:articleCaseToolbar and set up the parameters for caseID and articleID. The component renders correctly with the case information but the "Attach" and "Attach and Return Case" toolbar is not being rendered.
I am using the given template from the VF documentation and have tried a variety of IDs associated with the article:
<knowledge:articleCaseToolbar rendered="{!$CurrentPage.parameters.caseId != null}" caseId="{!$CurrentPage.parameters.caseId}" articleId="{!$CurrentPage.parameters.id}"/><br/>
Page is a standard controller for article type "Solution__kav" and I have a articleRendererToolBar on the page that renders fine with the Solution__kav.KnowledgeArticleid as the "articleID" parameter.
I have tried setting "articleID" to:
- $CurrentPage.parameters.id
- Solution__kav.KnowledgeArticleid
- Solution__kav.MasterVersionID
I even tried passing in a static article ID to no avail.
Does anyone have any information on setting up this tag, if the Attach buttons are even standard functionality as part of this VF tag, or if I am going something wrong with my setup?
Thanks!
If you want this 2 buttons, you need to create them using Apex and showing them using VF language.
I attached an example of code to do it:
- Create an Apex class that will extend the standardController:
In VF page:
I hope that helps.
All Answers
Hi,
The 2 button are not part of this VF component. We was not able to include them due to cross domain javascript issue.
Thanks, Francois.
Is there anyway to re-create this functionality through API calls?
If you want this 2 buttons, you need to create them using Apex and showing them using VF language.
I attached an example of code to do it:
- Create an Apex class that will extend the standardController:
In VF page:
I hope that helps.
Worked like a charm. Thanks!
Hi,
Any chance someone could post a test class for this class?
Cheers
The key piece in the unit tests is re-querying the KAV record prior to creating a standard controller based on it. This is because that field is set by the system when the KAV is inserted and will be NULL and cause an expcetion if not queried for.
Create your test Case and the rest of the code should work in conjunction with the controller Francois provided previously.
Great, Thanks! Will try that out today.
Cheers,
Ritchie