Post Created

forceChatter:postCreated

Fired when a post is made.

::::::tabset{tabs='[ "Develop", "Specifications"]'}

:::::tab

This event is fired when a post is created on the publisher, such as when you post to your profile feed and other feeds, create a poll, or create a question.

Handle the event by adding an aura:handler tag and defining a client-side controller action. You can handle this event when using forceChatter:publisher and forceChatter:feed, or on any page that has a publisher.

This example displays a toast message when a post is created, assuming the component is added to a record page. The toast is displayed when you create a post on the record page.

<aura:component implements="flexipage:availableForRecordHome" controller="ContactController">
	<aura:handler event="forceChatter:postCreated" action="{!c.handlePostCreated}"/>
	<lightning:notificationsLibrary aura:id="notifLib"/>
</aura:component>

This client-side controller displays the toast.

handlePostCreated: function(cmp, event, helper) {
     cmp.find('notifLib').showToast({
        "title": "Success!",
        "message": "You just shared a post."
    });
}

This event is handled by the one.app container. It’s supported in Lightning Experience, the Salesforce mobile app, and Aura-based Experience Builder sites.

:::::

:::::tab

Attributes

Name Description Type Default Required
feedItemId The ID of the feed item that has been created. string

:::::

::::::