Skip to main content

We are using tasks for correlation meetings. Users are assigned tasks and they can report on their progress using chatter.  In correlation we show the tasks in a list view.  On the left hand side of the tasks there is a “sk-icon-comments” chat bubble that is a Pop up and pulls in the tasks Chatter feed.  It would be awesome if I could show a comment count somewhere on the row so we could see if there are comments on the task.  If there aren’t it is a waste to click each one.  But if a task has comments it would be nice to know. 

Thoughts?  Or better ideas?

Thanks!

Rich,


You can use an aggregate model to count the chatter feeds for each Task and then show this count on a table of Tasks. On the row action, setup conditional rendering to only show the icon when the count of chatter feeds is greater than 0.


Here is an Account page sample that demonstrates this.


Thanks,


Bill



<skuidpage unsavedchangeswarning="yes" personalizationmode="server" showsidebar="true" showheader="true" tabtooverride="Account"> <models>
<model id="Account" limit="100" query="true" createrowifnonefound="false" adapter="salesforce" service="salesforce" sobject="Account" type="">
<fields>
<field id="Name"/>
<field id="CreatedDate"/>
<field id="Id"/>
<field id="ChatterCount" uionly="true" displaytype="FORMULA" label="Chatter Count" readonly="true" returntype="DOUBLE" precision="3" scale="0">
<formula>MODEL_LOOKUP("AccountFeedCount","countId","parentId",{{Id}})</formula>
</field>
</fields>
<conditions/>
<actions/>
</model>
<model id="Messages" limit="20" query="true" createrowifnonefound="false" adapter="salesforce" service="salesforce" type="" sobject="ChatterMessage">
<fields/>
<conditions/>
<actions/>
</model>
<model id="AccountFeedDrawer" limit="20" query="true" createrowifnonefound="false" adapter="salesforce" service="salesforce" type="" sobject="AccountFeed">
<fields>
<field id="ParentId"/>
<field id="Parent.Name"/>
<field id="Body"/>
<field id="Title"/>
<field id="RelatedRecordId"/>
</fields>
<conditions>
<condition type="fieldvalue" value="" enclosevalueinquotes="true" field="ParentId" state="filterableoff" inactive="true" name="ParentIdDrawer"/>
</conditions>
<actions/>
</model>
<model id="AccountFeed" limit="20" query="true" createrowifnonefound="false" adapter="salesforce" service="salesforce" type="" sobject="AccountFeed">
<fields>
<field id="ParentId"/>
<field id="Parent.Name"/>
<field id="Body"/>
<field id="CreatedDate"/>
<field id="LastModifiedDate"/>
</fields>
<conditions/>
<actions/>
</model>
<model id="AccountFeedCount" limit="" query="true" createrowifnonefound="false" adapter="salesforce" service="salesforce" type="aggregate" sobject="AccountFeed">
<fields>
<field id="Id" name="countId" function="COUNT"/>
</fields>
<conditions/>
<actions/>
<groupby method="simple">
<field id="ParentId" name="parentId"/>
<field id="Parent.Name" name="parentName"/>
</groupby>
</model>
</models>
<components>
<pagetitle model="Account" uniqueid="sk-3uKRot-80">
<maintitle>
<template>{{Model.labelPlural}}</template>
</maintitle>
<subtitle>
<template>Home</template>
</subtitle>
<actions>
<action type="savecancel"/>
</actions>
</pagetitle>
<skootable showconditions="true" showsavecancel="false" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Account" mode="read" uniqueid="sk-3uKRot-81">
<fields>
<field id="Name" allowordering="true" valuehalign="" type=""/>
<field id="ChatterCount" decimalplaces="" valuehalign="" type=""/>
</fields>
<rowactions>
<action type="edit"/>
<action type="delete"/>
<action type="drawer" label="Account Feed Drawer" icon="fa-arrow-down">
<drawer title="Drawer Area" width="90%" closehandle="true">
<components>
<skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="AccountFeed" buttonposition="" mode="read" uniqueid="sk-3uMSZ7-314">
<fields>
<field id="Body"/>
<field id="LastModifiedDate"/>
</fields>
<rowactions>
<action type="edit"/>
<action type="delete"/>
</rowactions>
<massactions usefirstitemasdefault="true">
<action type="massupdate"/>
<action type="massdelete"/>
</massactions>
<views>
<view type="standard"/>
</views>
<conditions>
<condition type="contextrow" field="ParentId" mergefield="Id" operator="="/>
</conditions>
</skootable>
</components>
<beforeload>
<action type="setCondition" model="AccountFeedDrawer" condition="ParentIdDrawer" value="{{Id}}"/>
<action type="requeryModel" model="AccountFeedDrawer" behavior="standard"/>
</beforeload>
</drawer>
<renderconditions logictype="and">
<rendercondition type="fieldvalue" operator="gt" enclosevalueinquotes="false" fieldmodel="Account" sourcetype="fieldvalue" field="ChatterCount" value="0"/>
</renderconditions>
</action>
</rowactions>
<massactions usefirstitemasdefault="true">
<action type="massupdate"/>
<action type="massdelete"/>
</massactions>
<views>
<view type="standard"/>
</views>
</skootable>
</components>
<resources>
<labels/>
<css/>
<javascript/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>

Love it!  Thanks Bill for creating an example. That was a great way to answer my question.  Sorry it took me so long to show my appreciation.  I was cycling through projects and just came back around.


Additional follow up.  This works great on the account chatter feed. When I tried applying it to the task chatter feed I got this error. “Field must be grouped or aggregated: Subject”

This post outlines why I was having the issues…  https://community.skuid.com/t/task-subject-field-not-available-for-selection-in-aggregate… . So it works for account, but tasks cannot be aggregated.  Thank you again!