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
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.
-
When I select multiple items, the Approve/Reject button is disabled, do you have any idea? (I am using SP2010)– WintCommented 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. Commented Apr 21, 2021 at 23:58
Visit http://.../_layouts/sitemanager.aspx
to access the Site Manager, select the files of interest and use "Actions" item in top nav bar.
(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.
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}&ItemId=' + window.deltacustom_selectedIds + '&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);
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.