Here's a screenshot of what it will look like within Einstein Analytics when we are complete.
Before we begin, this assumes that you have an Opportunity dataset that includes the "Name" and "Id" fields available from the Opportunity object. And that these are based on real opportunities that exist within your instance.
Let's get started.
- Activate the Developer Console
- Create a new Visualforce Page -> File -> New -> Visualforce Page
- Name the file "ChatterGlobalAction", or replace your name in the subsequent actions.
- Save the following text for the Visualforce page
<apex:outputPanel layout="block" style="overflow:auto;height:500px" >
<chatter:feed entityId="{!Id}"/>
</apex:outputPanel>
</apex:page>
- Go to Setup - Build -> Customize -> Opportunities -> Buttons, Links, and Actions (Note - for other global actions you might want to considering - Build -> Create -> Global Actions -> Global Actions)
- Create a "New Action"
Visualforce Page: ChatterGlobalAction
Height: 500px
Standard Label Type: <none>
Label: View and Post to Chatter
Name: View_and_Post_to_Chatter
Description: <blank>
Icon: <left as is>
- View an opportunity
- Activate the Edit Layout
- Click on Quick Actions
- Drag the "View and Post to Chatter" button to the quick action Publisher section
- Save the update
- NOTE (I need to update this with screenshots of editing the action framework UI for this and the next step) Create the following xmd file on your local computer and save it with a name like opp.xmd.json. This is the step that will activate the action framework within Einstein Analytics. If you look at the code below, when you invoke "visit the record", the linkTemplate specifies how to build the link to visit the record. You can activate this selection with either the "Name" or "Id" fields based on this configuration. The recordIdField indicates what to pass to the global action.
"dataset": {},
"dates": [],
"derivedDimensions": [
],
"derivedMeasures": [],
"dimensions": [
{
"customActions": [],
"field": "Name",
"linkTemplate": "/{{row.Id}}",
"linkTooltip": "Opportunity",
"members": [],
"recordDisplayFields": [],
"recordIdField": "Id",
"salesforceActions": []
},
{
"customActions": [],
"field": "Id",
"linkTemplate": "/{{row.Id}}",
"linkTooltip": "Opportunity",
"members": [],
"recordDisplayFields": [],
"recordIdField": "Id",
"salesforceActions": []
}
],
"measures": [],
"organizations": [],
"showDetailsDefaultFields": []
}
- Upload the XMD to your opportunity dataset
- Group Opportunities by Name
- Then you can pull up the action menu to select the new Chatter Global Action