Tag Info

New answers tagged

0

Quick fix Reference entry object by this keyword: this.entry = webList.addItem(entryCreationInformation); to make it accessible in handler, then you could grab list item id: function success() { console.log(entry.get_id()); }


0

You need to give entry the proper scope to be valid inside the success handler. The quick and dirty way to do this would be to make it a global variable. Then you can access it in the handler: function success() { var id = entry.get_item("ID"); }


0

What i understand from your question is you want to display recently added item in the same page. One simple way of doing this is:- Create a view, sort the view by Created and have Item Limit in the view to 5( or however number of recent records you want to see. Add a List View web part on your page, make sure you select the view you have ...


0

Below proof of concept, create item and add attachment via client object model. var list = Context.Web.Lists.GetById(listId); Context.Load(list); Context.ExecuteQuery(); var item = list.AddItem(new ListItemCreationInformation()); item["Title"] = "New Item with attachment"; item.Update() context.ExecuteQuery(); var attInfo = new ...


0

I was able to get this working using jquery and a siteColumn. Below is what i did. I created a site column names 'Internal Only' Added this site Column to any list that may contain information i want hidden if the user was off the network. I use jquery to grab the session As i mentioned above i have a session variable and cookie. in my javascript i get ...


6

AllowUnsafeUpdates=true; is not required to add/delete/update list items unless you are doing these operations in Page_Load or other Get methods. Both CASE 1 and CASE 2 does not look good in terms of best practice. Problems with both case code: Do not use oSPWeb.Lists["MyList"]; instead use oSPWeb.Lists.TryGetList("MyList1"); Do not use list.Items.Add(); ...


1

Both look same apart from the fact that AllowUnsafeUpdates is used in the second example. However, the better way of adding list items is SPList.AddItem() instead of SPList.Items.Add() See this for more explanation: SPList.Add() vs SPList.AddItem() SharePoint 2010



Top 50 recent answers are included