Skip to content

Instantly share code, notes, and snippets.

@F4bsi
F4bsi / ViewCounter.cmp.html
Last active August 2, 2019 14:39 — forked from JitendraZaa/AccountEdit.cmp.html
Salesforce Lightning view Counter Component which can be added to a Record Page to count the views on that record. The sObject needs the custom field "View_Count__c" as Number(18, 0).
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global">
<aura:attribute name="toUpdate" type="Object"
description="The record object to be displayed"/>
<aura:attribute name="toUpdateRecord" type="Object"
description="A simplified view record object to be displayed"/>
<aura:attribute name="recordSaveError" type="String"
description="An error message bound to force:recordData"/>
<aura:attribute name="viewCounted" type="Boolean" default="false"
description="Was the current view already added to the view Count?"/>