In this post we would be discussing on how we can disallow users to select the Published (Date-Time) field while creating a blog post in SharePoint. Like below:
Our aim is to set the Published automatically as per the current system's date-time.
If you are thinking to follow the usual way of hiding fields from the list form then you are not thinking about the impact it would have. I am talking about the below steps:Go to the Advanced Settings of this list, set Allow Management of Content Types equal to Yes. Click on the Post content type, click on the Published column, and select Hidden.
The user will no longer have the option to set the published date/time. Note that it will still be set, but will be set the default current time.
The above two steps will land you in trouble and your blog's date-time will not be visible on blog post, even in list view. To tackle this issue there is a trick here to get the date-time on the post without Published field being available to the user.
Create a SPD workflow to publish on Post list. In this workflow simply create one step to update thePublished field value with Modified field value as show in below image. Ensure to only select "Start the workflow automatically when an item is created" at the Start Options in SPD.
Now create a post after publishing the workflow and you will see the date-time on your post and even in the list view with Published column being unavailable to the author.
0 comments:
Post a Comment