+ Start a Discussion
stratus adminstratus admin 

knowledge article LastModifiedDate

I’m using the Visualforce knowledge:articleListcall. On the output of this is there any way to display the LastModifiedDate of the article??

 

Ie:

 

<knowledge:articleList articleVar="article" hasMoreVar="hasMore"categories="{!categoryGroupNameVar}:{!currentCategory}">

 

{!article.title}| {!article.LastModifiedDate}

 

</knowledge:articleList>

 

There is no documentation reference anywhere to the output variables fromthe ArticleList.

 

Interesting to note the SFDC error when an improper variableis called: it shows an authentication error.

 

-Scott 

etienne_getienne_g

Scott,

 

You can access the documentation of knowledge related components from Visualforce pages editor by clicking the component references button.

Your org needs to have Knowledge enabled. 

 

Etienne 

stratus adminstratus admin

Yes, and I guess what I am saying is that the component reference  is not very useful because it does not spell out the varaibles I can output. Right now I can only use the example and based on this I can see that I can refrence these items.

 

ID

Title

articleTypeLabel

 

 

My question is, how do I reference the LastModified date of an article (or others for that matter?? )

 

Also, how do I reference a custom field? I have a FAQ, I can show the Title (the question), but how do I show my custom field (answer)? I will need to output this on a VisualForce FAQ page..

 

-Scott 

FrancoisLptxFrancoisLptx

Hi,

 

If you want to display custom field of a specific article type. You will not be able to use this tag. you need to retrieve your article list with a SOSL or SOQL query and after display the artcle list.

 

Please see this example:

public List<FAQ__kav> getFAQFromKeyword() {
        List<List<SObject>> doclist = search.query('FIND \'my keyword\' IN ALL FIELDs '+
        'Returning FAQ__kav(ID, Title, UrlName, CustomTextField WHERE PublishStatus = \'Online\') ' +
        'WITH DATA CATEGORY Products__c ABOVE_OR_BELOW Mobile__c LIMIT 10');    
        
        List<FAQ__kav> faqlist = ((List<FAQ__kav>)doclist[0]);
        return faqlist;
    }

After you will display the result List:

<apex:dataList value="{!FAQFromKeyword}" var="each">
<apex:pageBlockSectionItem >
<a href='/articles/FAQ/{!each.urlname}' target='_blank'>{!each.title}_{each.CustomTextField__c}</a>
</apex:pageBlockSectionItem>
</apex:dataList>

 

 

cpocpo

Hi,

 

I also have a need to find out this information.

 

Is there any more update on this?

 

Thanks.

 

Chris

FrancoisLptxFrancoisLptx

Today, you can use the solution described on previous reply using SOSL, SOQL.

 

Notice that articleList component will be updated in Winter'11 and the field LastModifiedDate will be available.

 

Regards,

sean*harrisonsean*harrison

Doesn't this example assume you only want to show one article type? If one has multiple article types then one will have to write our queries to span all the relevent objects, correct?