Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: SPServices Add/update list item: Dynamically creating valuepairs

$
0
0
I got it working.

the syntax for creating object array is

var columnsForInsert = [];
        columnsForInsert[0] = ["Title", productPlan];
        columnsForInsert[1] = ["Product_x0020_Name", productName];
        columnsForInsert[2] = ["Product_x0020_Plan_x0020_Categor", productPlanCategory];
        columnsForInsert[3] = ["Fiscal_x0020_Year", fiscalYear];
        columnsForInsert[4] = ["Plan_x0020_Status", planStatus];
    ....
    ....
    ....
    ....
                        // Create New List Item
                        $().SPServices({
                            operation: "UpdateListItems",
                            async: false,
                            batchCmd: "New",
                            listName: "SEB Product Planning",
                            valuepairs: columnsForInsert,
                            completefunc: function (xData, Status) {
                                alert("List Item successfully Created.");
                            }
                        }); // End of SPServices UpdateListItems

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>