Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

The Situation

I have a workflow in a SharePoint 2007 List that require approval. Thus, there is a column called 'Approval Status' generated by SharePoint itself. How do I use SPServices to set the value?

The Code

        function CreateNewItem() {
            $().SPServices({
                operation: "UpdateListItems",
                async: false,
                batchCmd: "New",
                listName: "System A",
                valuepairs: [["Approval_x0020_Status", "Approved"]],
                completefunc: function(xData, Status) {
                   $("#responseStatus").html(Status);
                   $("#responseXML").text(xData.responseXML.xml);

                }
            });
        }

The above code is tested but it cannot change the Approval Status from Pending to Approved.

Update (Using Marc D Anderson Answer)

The full code:

    function CreateNewItem() {
        $().SPServices({
            operation: "UpdateListItems",
            async: false,
            batchCmd: "Moderate",
            listName: "System A",
            valuepairs: [["_ModerationStatus", "0"]],
            completefunc: function(xData, Status) {
               $("#responseStatus").html(Status);
               $("#responseXML").text(xData.responseXML.xml);

            }
        });
    }
share|improve this question
    
super man realy very very thankful to who has posted this –  user5648 Nov 15 '11 at 9:50
add comment

1 Answer

up vote 1 down vote accepted

Take a look at this thread in the SPServices discussions:

Looks like the answer is to use

 Cmd='Moderate' and ["_ModerationStatus", "0"] to approve
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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