Let's SharePoint

Client Object Model

  1. HOME
  2. Client Object Model
February 20, 2019 / Last updated : February 20, 2019 Sethu Client Object Model

How to report SharePoint list item versions in Office 365/SharePoint online?

Hello SharePointers, Below are Powershell script to get all the version history of all list items in SharePoint online/Office 365. $List = $Ctx.Web.Lists.GetByTitle($ListName) $Ctx.Load($List) $Ctx.ExecuteQuery() $Query = [Microsoft.SharePoint.Client.CamlQuery]::CreateAllItemsQuery() $ListItems = $List.GetItems($Query) $Ctx.Load($ListItems) $Ctx.ExecuteQuery() $VersionHistory = @() Foreach ($Item in $ListItems) { write-host “Processing Item:” $item.id -f Yellow #Get all versions of the list item $Versions […]

December 22, 2018 / Last updated : December 22, 2018 Sethu Client Object Model

How to delete large lists in Sharepoint online using Powershell

Add-PSSnapin Microsoft.SharePoint.Powershell -ea SilentlyContinue $web = get-spweb “https://mysite” $list = $web.lists[“Monster List”] $cquery = New-Object Microsoft.SharePoint.SPQuery $cquery.ViewAttributes = “Scope=’Recursive'” $cquery.RowLimit = 1000 $cquery.ViewFields = “” $cquery.ViewFieldsOnly = $true do { $listItems = $list.GetItems($cquery) $cquery.ListItemCollectionPosition = $listItems.ListItemCollectionPosition foreach($item in $listItems) { Write-Host “Deleting Monster Item – $($item.Id)” $list.GetItemById($item.Id).delete() } } while ($cquery.ListItemCollectionPosition -ne $null) Happy SharePointing […]

December 14, 2018 / Last updated : December 14, 2018 Sethu Client Object Model

How to add twitter feed in SharePoint Online?

Hello SharePointers, Below are the CSOM script to add twitter feed in SharePoint Online. var componment= page.AvailableClientSideComponents();ClientSideComponent clientcomponment = componment.Where(t => t.Id == GUID FOR COMPONENT ).FirstOrDefault();if (clientcomponment != null){ ClientSideWebPart webPart = new ClientSideWebPart(cv); page.AddControl(webPart); page.save(url);} Happy SharePointing 🙂

November 17, 2018 / Last updated : November 17, 2018 Sethu Client Object Model

How to hide SharePoint Column in Display/Edit/New form in SharePoint 2010/2013/2016/2019/Office 365?

Hello SharePointers, Below are the script to hide SharePoint Column in Display/Edit/New form in SharePoint 2010/2013/2016/2019/Office 365 script src=”//code.jquery.com/jquery-1.12.4.js” type=”text/javascript”> <script type=”text/javascript”> $(function () { $(“.ms-standardheader:contains(‘yourFieldName’)”).closest(“tr”).hide(); }); </script> Happy SharePointing 🙂

September 19, 2018 / Last updated : September 19, 2018 Sethu Client Object Model

How to check if the list level Throttling is enabled or not in SharePoint Online/2010/2013/2016?

  Hello SharePointers, Below is the Powershell script to check if the list level Throttling is enabled or not. Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue $webApplicationURL = Read-Host “Enter SharePoint Web Application URL” $reportPath = Read-Host “Enter full Path URL in the format” $webapplication = Get-SPWebApplication $webApplicationURL $sites = $webapplication.Sites Write-Output “SharePoint List URL” | Out-File $reportPath […]

August 31, 2018 / Last updated : August 31, 2018 Sethu Client Object Model

How to hide fields in SharePoint display form using Javascript in SharePoint 2010/2013/2016 /2019 and office 365?

Hello SharePointers, If you add external column in list, those columns will be visibile in your sharepoint display form by default. To hide sharepoint fields in sharepoint display form, you have to write the below script. <script language=”javascript” src=”https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js”></script><script language=”javascript”> $(document).ready(function () { $(“.ms-standardheader:contains(‘FieldName1’)”).closest(“tr”).hide(); $(“.ms-standardheader:contains(‘FieldName2)”).closest(“tr”).hide(); $(“.ms-standardheader:contains(‘FieldName3’)”).closest(“tr”).hide(); $(“.ms-standardheader:contains(‘FieldName4)”).closest(“tr”).hide(); $(“.ms-standardheader:contains(‘FieldName5)”).closest(“tr”).hide(); $(“.ms-standardheader:contains(‘FieldName6’)”).closest(“tr”).hide(); $(“.ms-standardheader:contains(‘FieldName7’)”).closest(“tr”).hide(); $(“.ms-standardheader:contains(‘FieldName8’)”).closest(“tr”).hide(); }); </script>​​​<br/>​<br/>   Happy […]

August 22, 2018 / Last updated : August 22, 2018 Sethu Client Object Model

How to add multiple users to People picker using JSOM in SharePoint 2010, 2013,2016,2019 Online & Office 365?

Hello SharePointers, Below is the JSOM script to add multiple user to people picker field in SharePoint list forms. function InsertUserstopeoplePicker() { var ctx = new SP.ClientContext(appWebUrl); var CtxSite = new SP.AppContextSite(ctx, hostWebUrl); var web = CtxSite.get_web();  var List = web.get_lists().getByTitle(‘Mytestlist’); var itemCreateInfo = new SP.ListItemCreationInformation(); var oListItem = List.addItem(itemCreateInfo); //Get User info var peoplePicker […]

July 25, 2018 / Last updated : August 15, 2018 Sethu Client Object Model

How to validate SharePoint list for First and Last name should be unique in Office 365/SharePoint online/2010/2013/2016?

Hello SharePointers, SharePoint online doesn’t allow two columns to be set as unique value for validation. Let us consider the business scenario, where first name and last name has to be unique in a SharePoint list. This can be achieved using REST API calls . Below are the code snippet that will help you to […]

February 22, 2018 / Last updated : February 22, 2018 Sethu Client Object Model

Server relative urls must start with SPWeb.ServerRelativeUrl – SharePoint Online Powershell error message?

Hello SharePointers, When you user Server relative urls in sharepoint online powershell , please ensure that you provide only relative urls to the copyto function. For example For instance, If you have following piece of code      $file =$ctx.Web.GetFileByServerRelativeUrl($att.ServerRelativeUrl) Write-Host $file.Name $ctx.Load($file) $ctx.ExecuteQuery() Write-Output “Hello” $NewName=$file.Name if($DestinationLibrary.EndsWith(“/”)){} else {$DestinationLibrary=$DestinationLibrary+”/”} Write-Host “Processing ” $file.Name $file.CopyTo($DestinationLibrary […]

January 30, 2018 / Last updated : January 30, 2018 Sethu Client Object Model

How to create a Survey in SharePoint using CSOM?

Hello SharePointers, Here are the CSOM code to create a survey list in SharePoint 2010/203 or SharePoint Online. public static void CreateSurveyList() { ClientContext ctx = new ClientContext(“http://mysite”); ListCreationInformation lci = new ListCreationInformation(); lci.Description = “Test Survey”; lci.Title = “First Survey”; lci.TemplateType = 102; List newSurveyList = ctx .Web.Lists.Add(lci); ctx .Load(newSurveyList); ctx .ExecuteQuery(); } Happy […]

Posts navigation

  • Page 1
  • Page 2
  • …
  • Page 4
  • »

Recent posts

How to insert table in Modern Pages using PnP Powershell in Office 365/Sharepoint Online?

June 7, 2019

How to set up Access Requests in SharePoint online using Powershell?

May 11, 2019

How to change the default SharePoint suite logo in SharePoint 2013/2016/2019?

April 30, 2019

How to add metadata to Document libraries in SharePoint online using powershell.

April 27, 2019

How to get Sharepoint site details using Powershell in Office 365?

April 17, 2019

How to get alerts for a specific policy in Cloud app security using Powershell

April 16, 2019

How to get the list of custom apps in App catalog using Powershell?

April 9, 2019

How to get the list of policies in Microsoft Cloud app security using window powershell?

April 4, 2019

How to get the list of List and Document library item counts in SharePoint online using Pnp Powershell ?

April 4, 2019

How to restore subsite in a Sharepoint online site collection using Pnp Powershell

April 2, 2019

Category

  • Anonymous access
  • Client Object Model
  • Client Side Object Model
  • Customization
    • Customization
  • Designer Workflows
  • Errors & Resolutions
  • Features
  • Google Analytics
  • InfoPath
  • Item Scheduling
  • JSOM
  • Nintex worflows
  • Office 365
  • Office 365 Groups
  • PnP JS Library
  • PowerShell
  • Powershell Online
  • REST API
  • REST API's
  • Server Side Object Model
  • SharePoint 2010
  • SharePoint 2010 Search
  • SharePoint 2013
  • SharePoint 2013 Search
  • SharePoint 2013 Workflows
  • SharePoint 2016
  • SharePoint 2019
  • SharePoint Designer
  • SharePoint Framework
  • SharePoint Online
  • SharePoint Pnp
  • SharePoint Usage Analytics
  • Unique values
  • User Profile Services
  • Windows Powershell
  • Workflow Manager

Archive

  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • January 2016
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • May 2015
  • April 2015
  • March 2015

Copyright © Let's SharePoint All Rights Reserved.

Powered by WordPress & Lightning Theme by Vektor,Inc. technology.