Newer Version Available
KnowledgeArticleVersionStandardController Class
KnowledgeArticleVersionStandardController
objects offer article-specific functionality in addition to what is provided by the StandardController.
Namespace
Usage
In addition to the method listed above, the KnowledgeArticleVersionStandardController class inherits all the
methods associated with StandardController.
Example
The following example shows how a KnowledgeArticleVersionStandardController object can be used to create a custom extension controller. In this example, you create a class named AgentContributionArticleController that allows customer-support agents to see pre-populated fields on the draft articles they create while closing cases.
Prerequisites:
- Create an article type called FAQ. For instructions, see “Create Article Types” in the Salesforce online help.
- Create a text custom field called Details. For instructions, see “Add Custom Fields to Article Types” in the Salesforce online help.
- Create a category group called Geography and assign it to a category called USA. For instructions, see “Create and Modify Category Groups” and “Add Data Categories to Category Groups” in the Salesforce online help.
- Create a category group called Topics and assign it a category called Maintenance.
If you created the custom extension controller for the purpose described in the
previous example (that is, to modify submitted-via-case articles), complete the
following steps after creating the class:
- Log into your Salesforce organization and from Setup, enter Knowledge Settings in the Quick Find box, then select Knowledge Settings.
- Click Edit.
- Assign the class to the Use Apex customization field. This associates the article type specified in the new class with the article type assigned to closed cases.
- Click Save.
KnowledgeArticleVersionStandardController Constructors
The following are constructors for KnowledgeArticleVersionStandardController.
KnowledgeArticleVersionStandardController(article)
Creates a new instance of the ApexPages.KnowledgeArticleVersionStandardController class
using the specified knowledge article.
Signature
public KnowledgeArticleVersionStandardController(SObject article)
Parameters
- article
- Type: SObject
- The knowledge article, such as FAQ_kav.
KnowledgeArticleVersionStandardController Methods
The following are instance methods for KnowledgeArticleVersionStandardController.
getSourceId()
Returns the ID for the source object record when creating
a new article from another object.
Signature
public String getSourceId()
Return Value
Type: String