This project has moved and is read-only. For the latest updates, please go here.

Blog Post Approval Status

Jan 21, 2013 at 1:42 PM
Edited Jan 21, 2013 at 1:42 PM

I'm using SPServices to Add/Edit/Delete items on a Blog Post collection in Sharepoint.  Everything is working as expected except the idea of Approval Status.  I can't seem to find how to change the approval status through services.

My code for updating the post works perfectly - except if I try to pass a value in for the Status of the post.  The field name seems to be:



So, if I pass in a value like:  ["_ModerationStatus", 0] or ["_ModerationStatus",2] in my UpdateListItems operation, the Status is ALWAYS set to pending - and the operation DOES NOT throw an error.  So, it doesn't mind me sending the "_ModerationStatus" field, it just doesn't do anything with the data.

Is there a separate operation for changing the Status of a Blog Post item?

Jan 21, 2013 at 2:53 PM

Found the solution:


        webURL: "yourwebsiteaddress",
        operation: "UpdateListItems",
        listName: "yourlistname",
        ID: yourlistidvalue,
        batchCmd: "Moderate",
        valuepairs: [["_ModerationStatus", 0]]


And just for fun, I worked up a list of the Status values:

hse.ModerateStatus = function (data) {
    var result = "";
    switch (parseInt(data)) {
        case 0:
            result = "Accepted";
        case 1:
            result = "Rejected";
        case 2:
            result = "Pending";
        case 3:
            result = "Draft";
        case 4:
            result = "Scheduled";

    return result;