2

enter image description here

In the screen shot above, there is a DateTime control field in the Form. Currently users set the values manually and then publish the post.

I want the Published Date to be set automatically and hide the DateTime control from the form.

5
  • 2
    I'm not sure I understand the question, the "published" field will select the current date-time at time of publishing, by default? What is it you want to change? Mar 2 '16 at 9:36
  • Currently user have to select the date time when he going to publish a post.Please refer the attached image. I want remove that date time controls from the blog post and input date time automatically.
    – TRS
    Mar 2 '16 at 9:40
  • 1
    as per your comment TRS, you only want to hide the date-time control on the form?
    – Zakir HC
    Mar 2 '16 at 9:46
  • I want to enter "published" date time automatically,at time of publishing.thank you
    – TRS
    Mar 2 '16 at 9:48
  • 1
    yes zakir.And need to automatically insert date time without the user selections.Thank you
    – TRS
    Mar 2 '16 at 9:50
2

The steps that @George mentioned is half a way correct. But the problem is if you hide Published column from the content type Post then its value will also hide from list view and post both. You can test this by creating a post in your blog and you will not see the date-time on the post.

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 the Published 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.

enter image description here

3
  • No it doesn't, it hides it from the form. You can still see the published date in a view. Mar 2 '16 at 10:28
  • @GeorgeGrainger you can perform the test at your side what you mention in your answer. And you would see no date-time on your post and even in your list view.
    – Zakir HC
    Mar 2 '16 at 10:35
  • 1
    My apologies, you are correct. Seems an oversight by SharePoint. @TRS - JavaScript would be your alternative here, to hide the Published field whilst still retaining the value Mar 2 '16 at 10:43
2

Ahh I see, in response to your comment above then:

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.