Hot answers tagged

7

Try adding the type="text/javascript" in the <script> tag references, like this: <script type="text/javascript" src="http://yoursite/sites/yourlibrary/jquery.min.js"></script> <script type="text/javascript" src="http://yoursite/sites/yourlibrary/StickyHeaders_v2.9BETA.js"></script> Also see these posts: sharepoint 2013 / ...


6

You could create a Custom WebPart. A simple button Handler could execute the under given code to fire your PowerShell script. scriptText parameter is the script which you should pass. You can HardCode it or load it from any file. private string RunScript(string scriptText) { // create Powershell runspace Runspace runspace = RunspaceFactory....


6

Copy your SharedPoint document library URL for example, http://sumon-pc/sites/dc/ts/Shared Documents Open Windows Explorer, right click My Computer and select Map Network Drive Choose drive letter that you want to use, then enter the URL that you copied in step 1. Then click finish. If prompt for username and password enter your SharePoint login username and ...


6

You can use a text file to get the list of Web URLs, and loop through this list in PowerShell UPDATED POWERSHELL SNIPPET Get-Content 'FULL PATH\\FILENAME.txt' | Foreach-Object { $web = get-spweb $_ $web.UIVersion = 3 $web.UIVersionConfigurationEnabled = $true $web.Update() $web.Dispose() } Its better to dispose the $web object after the operation is done. ...


5

Something like the following: $web = Get-SPWeb -Identity 'http://www.spsite.com/subsite' $List = $web.Lists['MyList'] $column = $List.Fields.GetFieldByInternalName('Title') $column.Hidden = $true $column.ShowInDisplayForm = $false $column.ShowInViewForms = $false $column.ShowInEditForm = $false $column.ShowInListSettings = $false $column.Update() # To ...


4

You seem to miss a # on your second line of jQuery, change as below $(document).ready(function () { $("#DeltaSiteLogo a").prop("href", "/"); $("#DeltaSiteLogo a").prop("onclick", ""); }); or set it in a one-line $(document).ready(function () { $("#DeltaSiteLogo a").prop("href", "/").prop("onclick", ""); }); If that does not work it may be a ...


4

I think you need to put url instead SiteUrl it will be like this : string url = SPContext.Current.Site.Url; however this code will not run try to use page variable _spPageContextInfo : string url = _spPageContextInfo.siteAbsoluteUrl; Note : If you use SPContext in Client Object Model code it would be null.


3

Just a five minute pseudocode, this should work... add-pssnapin microsoft.sharepoint.powershell $SPWeb = get-spweb http://sharepoint/sites/sitecollection/subsite $owner = "domain\adminuser" $op = New-SPClaimsPrincipal $OwnerName -IdentityType WindowsSamAccountName $owner = $SPWeb | Get-SPUser $op $csvlocation = "c:\csv\users.csv" $values = Import-Csv $($...


3

Try this instead. I've also fixed some errors in your code. _spBodyOnLoadFunctionNames.push("Init"); function Init(){ alert("Before SPCascade"); $().SPServices.SPCascadeDropdowns({ relationshipList: "List 1", relationshipListParentColumn: "List 2", relationshipListChildColumn: "Title", parentColumn: "List 2", ...


3

here is a script which will give you some # Get current date $date = Get-Date # Show current date Write-Host "Looking for running jobs with a Last Run Time of greater than or equal to" $date # Get all Timer jobs and iterate Get-SPTimerJob | ForEach-Object { # Get last run time for job $lastRunTime = $_.LastRunTime # If run time is greater than/...


3

Each of your webparts should have its own unique ID in the code. Use developer tools (F12) to examine your page. You should be able to then target CSS to only elements inside of a particular ID Web Part 1's ID is a called #content To target class elements inside only Web Part 1, you would do something like div#content.myClass


3

The execution of the script is from top to bottom. You have declare both of the variables at top, so they will get assigned with values. After that you have defined few methods which makes use of it. During script execution these method definitions will not be executed unless they are called. Which I think is part of your question. So to start or run the ...


3

In order to get the new menu structure the easiest way will be to modify the existing view or create a new view for that document library or list. To do so perform the following steps: Go to your document library or list In the ribbon clock on Library and then either Modify View or Create view Once the view opens up you will scroll down to the bottom ...


3

You have multiple options: load JS files with JSLink assigned to a WebPart, easy to do with the SharePoint UI, but less easy to maintain (and you need a WebPart that can do JSLink on the page) set UserCustomAction ScriptLinks, these are functionaly the same as MasterPage ScriptLinks and JSLinks but are stapled on the SiteCollection or only one Web. They do ...


3

You will need to use a CAML query to get a subset of list items and page through the results. Make sure you set the RowLimit on the query so that you only get a limited number of items at a time. You also need to include an OrderBy clause in your CAML query. After retrieving the first page of results, set the your query's SPQuery.ListItemCollectionPosition ...


3

<style type="text/css"> #dialogTitleSpan { display:none; } </style>


3

Just add another attribute for your button i.e. style attribute. You can put any style you like within it. In your case you can go with following code: <input type="button" style="font-size: 24px; font-family: Arial, Helvetica, sans-serif;" onClick="CoreInvoke(&#39;createNewDocumentWithRedirect2&#39;,event,&#39;LINK.pptx&#39;, &#39;...


3

@("url.1", "url.2") | %{ $web = get-spweb $_ $web.UIVersion = 3 $web.UIVersionConfigurationEnabled = $true $web.Update() } consider using try/finally in combination with $web.Dispose() if you have many urls...


3

User Profile Properties doesn't support a Default Value


3

Here is the example from original post converted to JSOM API: function createFolder(list,folderUrl){ var createFolderInternal = function(parentFolder,folderUrl){ var ctx = parentFolder.get_context(); var folderNames = folderUrl.split("/"); var folderName = folderNames.shift(); var ...


3

Check the article: Customizing "modern" lists and libraries We can't add JavaScript or CSS code in the modern list view page. As a workaround, we can hide the column value using column formatting below, we can't hide the whole column if you need use this column value in another column formatting. { "$schema": "https://developer.microsoft.com/json-...


2

May your problem is caused by MDS (minimal download strategy). Since your code is on the page but is not interpreted again, you have to attach it to the page lifecycle. For example with JQuery: $(function () { ExecuteOrDelayUntilScriptLoaded(function () { if (typeof asyncDeltaManager != "undefined") asyncDeltaManager....


2

SharePoint may re-write your code in the content editor webpart. I suggest you take one of two approaches: In 2010/2013 you can create a txt file and store in a library. I suggest you place your code in that file and use the Content Link property of the Content Editor Web Part. This will avoid SharePoint overwriting your code or doing something funky ...


2

If you have language packs installed, then we should use DescriptionResource for setting the values $myWeb.DescriptionResource.SetValueForUICulture($myWeb.UICulture, "Some test description")


2

Below script will upload file recursively from folder to document library if((Get-PSSnapin "Microsoft.SharePoint.PowerShell") -eq $null) { Add-PSSnapin Microsoft.SharePoint.PowerShell } Function UploadFiles($web,$path,$docLibrary) { $files = Get-ChildItem $path foreach ($file in $files) { if($file.GetType().Name -eq "DirectoryInfo") { ...


2

It's achievable through PnP PowerShell CmdLets, you need to install the msi before using it. SPOAppPackage -Path c:\files\demo.app -Force Refer to other switch parameters for more options. More details here


2

I found the issue: Instead of using $spWeb = $spSite | Get-SPWeb I used $spWeb = $spSite.RootWeb and it worked fine.


2

You need to delay for sp.js I guess for using $().SPServices. In SharePoint 2010 ExecuteOrDelayUntilScriptLoaded(functionTobeCalledNext, "sp.js"); In SharePoint 2013 SP.SOD.executeFunc('sp.js', function () { // code goes here }); Ignore jQuery document ready. It doesn't ensure that sp.js is loaded.


2

In this line $_["Today"] = [System.DateTime] apart from the “ vs " quotes (which I believe are OK in your script as per the output), you need to assign a date object e.g. $_["Today"] = [System.DateTime]::Today. The [System.DateTime] expression represents the DateTime class, but it's not an instace of it. Apart from that, the $list.Update() is only ...


2

keep in mind that the script will not run when in post back, so, you have to save the page (stop editing) and then press Enter in the url address bar in your browser. Refresh with F5 may still not work!


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