Tag Info

Hot answers tagged

3

var clientContext = SP.ClientContext.get_current(); // Gets current site context var id = GetItemID(); //retrieve selected list item id to update data var listId = SP.ListOperation.Selection.getSelectedList(); var oList = context.get_web().get_lists().getById(listId); this.oListItem = oList.getItemById(id); function GetItemID() { var selectedItems ...


3

I think you mean that result item collection is empty: $itemsCollection = $list.GetItems($spQuery) if($itemsCollection.Count -eq 0) { Write-host " No results were found" }


3

SP 2013 uses clienttemplates.js to create the those views control. You can either create a JSLink or add the following script using the script Editor webpart to the page where your list view resides. <script type="text/javascript"> ExecuteOrDelayUntilScriptLoaded(overrideSurfacePivotCount, 'clienttemplates.js'); function overrideSurfacePivotCount() { ...


2

You cannot clear the ID field out of the box in SharePoint Instead the list can be taken as template and then delete and recreate it with the saved template


2

If you are using Powershell, be sure to use the parameter -includeusersecurity. But be careful as this backups all the permission up to the site collection tier. It wont matter if you do it from Central Admin ( clicking 'export full security' ) or Powershell. You must do it this way to retain the user data for all the list items. Be cautious while using ...


2

As far as i understand your query, you can use following code: using (var site = new SPSite("http://yourserver/")) { using(var web = site.OpenWeb()) { var list = web.GetList("YourListUrl"); var dataTable = list.Items.GetDataTable(); // your code } }


2

You can use the SP.ListOperation.Selection class getSelectedItems() method to get the selected list items. You will get the IDs of the selected list items based on which you can do the further processing. Here is a good post. You might also want to consider going through this post.


2

Try to use [Double]::Parse("xxx") $item["currencyfield"] = [Double]::Parse("123.48"); $item.Update(); You can find a complete guide about powershell and list s fields here: getting-and-setting-fields Powershell


2

I would recommend to utilize Web.GetSubwebsForCurrentUser method instead Web.Webs property since it returns the security trimmed (the current users has access) list of sub sites. Modified example var objectsToInclude = new Expression<Func<Web, object>>[] { w => w.Title, w => w.Url, w => w.Lists, ...


1

Let $web be the SPWeb object where your list is, and let $item be the SPListItem that your script is working on. Here is how to extract the SPUser from $item: Function Add-SPUserFromListToOwnersGroup { param ( [Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [Microsoft.SharePoint.SPListItem] ...


1

Yes, you can query search using the REST API with the following URL to get list items specific to a content type http://yoursite.domain.com/_api/search/query?querytext='contenttype:CONTENT_TYPE_NAME' To find out more about search using REST see this and this


1

The new page added in layouts folder "inplview.aspx". When paging, sorting or filtering happens there is an AJAX call to the inplview.aspx and it returns a JSON based result set. That is the rows of the defined list view webpart. The "inplview.aspx" generates the "inplviewhash" tag and appends it with "#" in url.


1

You'll need to make that insert into list B as an impersonation step. This used to be an option in 2010 that would allow workflow actions to execute as the user who publishes the workflow. I'm not very familiar with 2013 yet, but I believe this was moved into a feature that isn't enabled by default called an App Step. See if this article helps you, ...


1

Looks like it is a DLL caching issue. When you start Powershell command line window, it loads all DLLs available in the GAC. So, if you have updated DLL for the feature receiver, and deploying it within the same PS session then it will not reload updated DLL. I had experienced similar behaviour before. To tackle it, I created two seperate PS1 files. First ...


1

You can create List in SharePoint subsites too. try this code: using (SPSite oSPsite = new SPSite("your sitecollection URL")) { oSPsite.AllowUnsafeUpdates = true; using (SPWeb oSPWeb = oSPsite.OpenWeb("your subsite URL")) { oSPWeb.AllowUnsafeUpdates = true; oSPWeb.Lists.Add("Your List Name", "Description", ...


1

Change the ConvertLoginName method to: public static SPFieldUserValue ConvertLoginName(string userid) { // Try to get the SPUser value if userid is a user or AD group that has been imported into SharePoint by the UPS. try { SPUser requireduser = _web.EnsureUser(userid); SPFieldUserValue uservalue = new SPFieldUserValue(_web, ...


1

var clientContext, hostweburl, parentContext, parentWeb, listItems; clientContext = new SP.ClientContext.get_current(); hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl")); parentContext = new SP.AppContextSite(clientContext, hostweburl); parentWeb = parentContext.get_web(); var id = GetItemID(); // Gets Selected item's ID var listId ...


1

1) You can edit the page that contains each view (Site Actions > Edit Page) and then insert a Content Editor Web Part. Within this web part, you can add links to each of your views and format/style them as needed. 2) The property that controls the default value is hidden by the XsltListViewWebPart control, so unfortunately we can't modify it to be a value ...


1

Solution: Reason and because of the solution: I will use a utility OData plate, used in SharePoint 2013 and 2010 When migrating from 2010 to 2013 will not have conflict. If you want to know more follow the link: http://msdn.microsoft.com/en-us/library/hh166950(v=nav.71).aspx First step: See how are the names of each column: In your script put the ...


1

I agree with PirateEric. A forms library will only be required if the features of a list form are not sufficient. If you can make do with a list form, you can save all the extra work required to promote fields to library columns and all list columns are available to Excel by default. Other advantages of a list compared to a library: you can configure ...


1

SP.ListOperation.Selection Class provides static methods for selecting lists or list items. SP.ListOperation.Selection.getSelectedItems() method returns the list of items being selected. Selected list item contains the following properties: id - list item id fsObjType - file system object type The following example demonstrates how to retrieve selected ...


1

If you don't want to a coded solution, you can always go to the LIST-tab and hit the Quick Edit Button and you have your datatable rigt out of the box.


1

By default, you should see a Deployment Conflicts dialog box when you redeploy your solution to your development computer; this should have warned you that your existing list instance would be overwritten. To change this behavior, select the List Instance in Solution Explorer, and then change the Deployment Conflict Resolution property (in the Properties ...


1

Provide the second parameter in ClientRuntimeContext.Load method in order to specify the list of the properties to retrieve from the server, for example: ctx.Load(listItems, icol => icol.Include(i => i["<field name>"])); The following example demonstrates how to load Title and Status properties only for task items: using (var ctx = new ...


1

You can use following code: ClientContext context = new ClientContext("http://SiteUrl"); // Assume the web has a list named "Announcements". List announcementsList = context.Web.Lists.GetByTitle("Announcements"); // This creates a CamlQuery that has a RowLimit of 100, and also specifies Scope="RecursiveAll" // so that it grabs all list items, ...


1

Consider setting up permissions right after the topic is created. In simplest case you can do it manually: click Manage discussions link, select discussion and click Shared With: Or you can create a workflow for that, that would pick the settings from the field. This opensource project provides a set of workflow actions for setting permissions: ...


1

The issue you have is, you are looping till index i reaches RoleAssignment count and within the loop you are removing the RoleAssignment one by one. This means, the loop count decreases by one. So, on every run, it will only loop half the total no of permissions. So, you have to run multiple times to delete all permissions. What you can do is create an ...


1

Chris, Your impression is correct. If you index a column, filter on it, and if the results returned are less than or equal to the list view threshold (5000), then you will be able to see the results returned by the query. The only reasons I can think of for this not work would be: You are filtering on other columns that are not indexed. You are ...


1

There are two ways I can think of. Create a timer job. Schedule a SharePoint TimerJob to run daily or for every n number of hours and populate a list which will contain the excel file content. Design a Business Connectivity Service through Visual Studio and let it read data from the excel file every time it is loaded. This does not have any issue from the ...


1

Probably because your browser or firewall doesn't like the "MERGE" request type... Generally you use POST as the type with MERGE or PATCH (as you have used) as the X-HTTP-Method Try changing your second $.ajax to: $.ajax({ url: "/_api/web/Lists/getbytitle('IconLinkList')/Items(" + id + ')', type: "POST", data: ...



Only top voted, non community-wiki answers of a minimum length are eligible