creating sharepoint list item using javascript

To create a sharepoint list item using Javascript we will use lists.asmx web service available in sharepoint.

The Code :
You can call the CreateListItem function (below) in your webpart code(aspx,ascx files)to create a sharepoint list item. CreateListItem function further calls createEnvelope funcion to create a list item.

In use your server name . If you are using the below code in a subsite then use the url of subsite in to open up the lists.asmx

eg, use http://servername/subsite1/subsite2/_vti_bin/lists.asmx when you are using code in subsite2.

The Listname in createEnvelope is the list guid and the Field Name would be the internal name\id of the field.

You can also open the lists.asmx webservice in your browser to see more functions. for eg, GetlistItems to query or return all the items in the list and lot more.


Post a Comment


This is a personal weblog. The opinions expressed here represent my own and not those of my employer or anyone else. Should you have any questions or concerns please e-mail me at .

Copyright (c) 2010 @ All rights are reserved.Do Not Copy.

@ Learning