1

We are currently building a community using VF together with bootstrap to achieve the clients requirements with regards to Design. We are using KnowledgeArticles in a section and wanted to achieve the "New!" and "Updated!" functionality that Salesforce has when viewing them internally.

The KnowledgeArticle has a field called LastViewedDate which is in the context of the running user to determine when the article was last viewed by the user which we can leverage in conjunction with the KnowledgeArticleVersion object to determine if it is old, new or updated. The problem we are facing is having to update the LastViewedDate field on the KnowledgeArticle when they visit the public document link.

Internally the view of the detail page of the Article triggers this update to the ReadOnly field. How can we trigger this update from the community?

1 Answer 1

1

I originally posted the question as the LastViewedDate wasn't being updated when the Community user accessed the public link to the Article's file. The solution to this one was not too complicated - We created a visualforce page for the community user to access the Article using the standard controller. Accessing the page did in fact update the LastViewedDate for the current user:

<apex:page standardController="knowledge__kav" showHeader="false" id="pageId" standardStylesheets="true">
    <apex:form id="frmId">
        <apex:outputField value="{!knowledge__kav.Title}" />
        <apex:outputField value="{!knowledge__kav.Summary}" />
        <apex:outputField value="{!knowledge__kav.Featured_Image__c}" />
    </apex:form>
</apex:page>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .