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

New Post: Odd: Can't add columns to a list

$
0
0

Fiddling a little, and hard-coding the list name in:

 //Add field: Score

    var newFields = "<Fields>";
    for(i=1; i <= 100; i++) {
      newFields += "<Method ID='" + i + "'>" +
        "<Field Type='Text' DisplayName='Column_" + i + "' FromBaseType='TRUE' MaxLength='255' Description='Description of Column_" + i + "' />" +
        "</Method>";
    }
    newFields += "</Fields>";
    // Add a lot of columns to the list
    $().SPServices({
      operation: "UpdateList",
      listName: 'test1',
      newFields: newFields,
      completefunc: function (xData, Status) {
        alert(Status);
        alert(xData.responseText);
      }
    });

Gives me an error saying the list doesn't exist. Then the second time it looks like it works but doesn't create the column :'(


Viewing all articles
Browse latest Browse all 6517

Trending Articles



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