Tuesday, March 27, 2012

Publish Date functionality for Announcements

The ideas for this set of articles comes from user questions on Stump the Panel regarding customizations and optimizations to announcements lists on SharePoint sites. I will cover the following customizations:

  • Create a Publish Date feature for announcements
  • Create alerts based on announcement categories
  • Modify the default “Current View” of the announcements Web Parts
  • Create a “More” link to view the details of each announcement

Create a Publish Date functionality for Announcements


Here’s how to create a publish date for each of your announcements, where the announcement will automatically be “published” when the date arrives.

  1. Turn on content approval on your announcements list like this:
    In the list’s settings, go to Versioning settings.
    Change “Require content approval for submitted items?” to Yes
    Date Functionality
  2. Create a new Date and Time column in your announcements list called “Publish Date”, and make it a required column. You can even make it default to today’s date if you’d like.
  3. In SharePoint Designer, create a workflow like this: Open SharePoint Designer, and click <File> and <Open Site>. Paste in the URL of the site where you’d like to create the workflow, and open it. Click <File>, then <New…>, then <Workflow…>
    Date Functionality
  4. Name this workflow “Create Announcement”
  5. Pick your Announcements list from the drop-down list. Only check the box “Automatically start this workflow when a new item is created”.
  6. Add the first condition to “Compare Announcements field”. If the field Publish Date is less than or equal to (then, click on value, and choose the little parameter builder button)
    Date Functionality
    Then, choose Current Date, and click OK.
  7. In the Actions section, choose Set Content Approval Status. Set content approval status to “Approved”, and add comments such as “item automatically approved on publish date”
  8. But, if the announcement is supposed to be published on a future date, we need the workflow to wait. Click to Add ‘Else If’ Conditional Branch. In the new branch’s Action section, choose Pause Until Date. Click on this time, and click the function button to display the data binding menu
    Date Functionality

    With the Source as Current Item, choose Publish Date as the field. Click OK.
    Date Functionality
  9. The second action will be the same as the action on the previous branch.
    Set content approval status to “Approved”, and add comments such as “item automatically approved on publish date”

Here’s what your workflow screen will look like:

Date Functionality

We used “is less than or equal to Today” as the condition (instead of is equal to today) because it’s possible that a user could enter in a past date as the publish date. A condition is not needed in the second branch because it knows that if the condition in the first branch is not met, then otherwise do this.

1 comment:

  1. source: http://www.nothingbutsharepoint.com/2009/03/03/fun-with-attachments-part-1-aspx/

    ReplyDelete