4

I have many documents which need to be published to a major version than approved. Is there a way I can batch select multiple documents and approve simultaneously?

4 Answers 4

2

Yeah, its easier than you might think. From the Approve/Reject view the ability to check items is removed. However, from the all items view (or custom views to help you filter) simply check the items you want to approve, then in the Items ribbon, on the far right you'll find Approve/Reject (icon is a doc page with a check and an x on it). Clicking that with multiple items selected will apply the approval status to all selected items. The same applies for Document Libraries, except the Items ribbon is the Files ribbon.

3
  • When I select multiple items, the Approve/Reject button is disabled, do you have any idea? (I am using SP2010)
    – Wint
    Commented Sep 23, 2014 at 0:54
  • As stupid as it may sound try unselecting them and then selecting them again. I've seen it be that simple sometimes those ribbon links get screwy. If that doesn't work you may not have permission to approve content on one of the selected items for some reason. Also, I'm not sure but they may need to be checked in (docs) and maybe need to be major versions? Commented Sep 24, 2014 at 2:11
  • @Wint You might need to Check In first. In the same "Files" Ribbon, choose Check In while all the files are selected.
    – localhost
    Commented Apr 21, 2021 at 23:58
2

Visit http://.../_layouts/sitemanager.aspx to access the Site Manager, select the files of interest and use "Actions" item in top nav bar.

Image of 3 selected files, about to be Published

(In Sharepoint Server 2013. I don't know if it's the same for other versions).

Found by way of Famous SharePoint URLs & Locations on MS Developer Blogs.

1

I have implemented batch task approve/reject button with visual studio farm solution, hope this might help someone (content approval status can be changed by workflow, though not necessarily)

Check my code here: https://github.com/wintlu/DeltaCustom/tree/master/FarmSolution

Create VS farm solution, add element and type this into Element.xml:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
   Id="DeltaCustom.Action"
   Location="CommandUI.Ribbon"
   RegistrationType="ContentType"
   RegistrationId="0x0108"
    >
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
          Location="Ribbon.ListItem.Actions.Controls._children">
          <Button Id="DeltaCustom.Action.BatchReview"
                  Command="DeltaCustom.Action.BatchReview"
                  LabelText="Batch Review"
                  Sequence="12"
                  TemplateAlias="o1" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
          Command="DeltaCustom.Action.BatchReview"
          CommandAction="javascript:window.location='{SiteUrl}/_layouts/DeltaCustom/BatchReview.aspx?ListId={ListId}&amp;ItemId=' + window.deltacustom_selectedIds + '&amp;Source=' + window.location"
          EnabledScript="javascript:function singleEnable()
          {
            var selectedIds = []
            var items = SP.ListOperation.Selection.getSelectedItems();
            for(var i in items){
              selectedIds.push(items[i].id);
            }
            window.deltacustom_selectedIds = selectedIds.join('-');
            return (items.length >= 1);
          }
          singleEnable();" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
</Elements>

Add an aspx page, add some buttons(approve, reject etc), then in the approve action:

Hashtable ht = new Hashtable();
ht["Status"] = "Completed";
ht["PercentComplete"] = 1.0f;
ht["TaskStatus"] = approve ? "Approved" : "Rejected"; // some people say this works: "#" : "@";
ht["ows_FieldName_Comments"] = ReviewComment.Text;
var succeed = SPWorkflowTask.AlterTask(i, ht, true);
1
  • Github link is throwing 404 error.
    – zed
    Commented Mar 13, 2018 at 14:24
0

I keep running into this and forgetting how I did it. Just remembered-Hopefully this helps someone (possibly even future me for when I forget and search again).

I just added a field to the list called "Batch Approve Trigger" (or whatever you'd like) and gave it an initial value of "1". Created my workflow to update approval status from draft-->pending-->approved. Set the work flow to run any time an item is changed. Changed all "Batch Approve Triggers" to "2" (drag select paste in list datasheet view). Viola - the workflow runs on all changed items and sets status to approved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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