Domanda

I have a request to add a save draft button in a new form!

how to add this button using javascript and when the user clicks it update list item field Draft to yes?

È stato utile?

Soluzione

If your goal to handle the Draft process, so I suggest you think first SharePoint!

The SharePoint already handle the Draft process as the following:

Option 1

Draft items in Document library:

You can handle the draft files by Enabling Check-Out and Check-in functionality

  • Library setting > Versioning Settings.
  • Below Require Check Out, check Yes.

enter image description here

Now check out the file, edit and save it as a draft, then reflect your changes by performing check-In

Note: Check-Out and Check-in functionality is not available for list

Draft items in List:

You can enable the versioning with Content Approval to handle the draft items by doing the following:

  • Open List setting > Versioning Settings.
  • Enable Content Approval, versioning.
  • Set The draft item security as you prefer.

enter image description here


Option 2

You can also manage Draft as OOTB as the following:

  • Create a Yes/No draft field with default value No

enter image description here

  • Create a view to filter with Draft = Yes and Created By = [Me]

enter image description here


Option 3

If you have SharePoint Enterprise edition, you can use InfoPath to customize your form as the following:

  • Add a new Button, set the display name to Save To Draft.
  • Add a rule to set the Draft status to Yes.

If the above options are not satisfied with your requirements, and you need to do it by adding a button manually, you can check:

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top