Use the ConnectApi.Announcements class to get, create, update, and delete announcements. Use an announcement to highlight information. Users can discuss, like, and post comments on announcements. Deleting the feed post deletes the announcement.
This image shows an announcement displayed in a group. Creating an announcement also creates a
feed item with the announcement text.An announcement displays in a designated location in the Salesforce UI until 11:59
p.m. on its expiration date, unless it’s deleted or replaced by another
announcement.
The following are methods for Announcements. All methods are static.
31.0
Yes
public static void deleteAnnouncement(String communityId, String announcementId)
Type: Void
To get a list of announcements in a group, call getAnnouncements(communityId, parentId) or getAnnouncements(communityId, parentId, pageParam, pageSize).
To post an announcement to a group, call postAnnouncement(communityId, announcement) .
31.0
Yes
public static ConnectApi.Announcement getAnnouncement(String communityId, String announcementId)
Type: ConnectApi.Announcement
To get a list of announcements in a group, call getAnnouncements(communityId, parentId) or getAnnouncements(communityId, parentId, pageParam, pageSize).
To post an announcement to a group, call postAnnouncement(communityId, announcement) .
36.0
Yes
public static ConnectApi.AnnouncementPage getAnnouncements(String communityId, String parentId)
36.0
Yes
public static ConnectApi.AnnouncementPage getAnnouncements(String communityId, String parentId, Integer pageParam, Integer pageSize)
36.0
Yes
public static ConnectApi.Announcement postAnnouncement(String communityId, ConnectApi.AnnouncementInput announcement)
Type: ConnectApi.Announcement
31.0
Yes
public static ConnectApi.Announcement updateAnnouncement(String communityId, String announcementId, Datetime expirationDate)
Type: ConnectApi.Announcement
To get a list of announcements in a group, call getAnnouncements(communityId, parentId) or getAnnouncements(communityId, parentId, pageParam, pageSize).
To post an announcement to a group, call postAnnouncement(communityId, announcement) .