New answers tagged

0

You can use the following: For Site Collection URL: var url = window.location.protocol + “//” + window.location.host + _spPageContextInfo.siteServerRelativeUrl; For Sub Site URL: var url = _spPageContextInfo.webAbsoluteUrl;


0

You will have to add a column to your list view, then choose Type as Date and Time and put the default value as Today's Date. You create a new column under views in Library settings.


2

Create One Calculated type column and set data return formula type to Number and apply this formula: ="<img src='/_layouts/images/blank.gif' onload=""{"&" var day=new Date();"&" this.parentNode.innerHTML= day ;"&"}"">" You will current date and time. UPDATE For only Date try below formula: ="<img src='/_layouts/images/blank.gif' ...


0

You create the column as you'd like, and set the default value to Todays Date.


1

You need to reference Microsoft.Office.Word.Server which is located in the GAC (C:\Windows\Microsoft.NET\assembly\GAC_MSIL). It is not safe to reference Microsoft.Office.Interop.* assemblies in a server application.


0

After you're being sure test actually exists and is not null itself, try in that order: SPContentType test = web.AvailableContentTypes["test"]; newList.ContentTypesEnabled = true; newList.Update(); newList.ContentTypes.Add(test); First note that we need to update the list after setting ContentTypesEnabled to true (ContentTypesEnabled must be true so we ...


1

I can think of three ways in which this code has gone wrong. The long URL that you are mentioning is actually a view inside a site collection which is not the root site collection. Meaning that you are trying to access a the root site collection instead of the actual site collection. The easiest way of knowing this would be to check if there is a "sites" ...


0

Adding something to @P S. You can also check following youtube video by Rackspace for branding: Branding Internet Facing Web Sites with SharePoint 2013 (Full Session) This session will focus on creating branded Internet-facing sites using Public Websites in SharePoint Online but most of the techniques will apply no matter where your SharePoint ...


1

I don't think you need to learn C# and Asp.net for branding. For branding you will need to have knowledge of HTML and CSS. You can get tons articles on Google for SharePoint 2013 branding . For e.g. http://en.share-gate.com/blog/where-and-how-to-start-branding-sharepoint C# and Asp.net comes in the picture when you want to develop custom solutions which ...


0

In SharePoint 2013 there is no need to use alter the task. Directly access the list Workflow Tasks and update the item. Following code worked for me: using (SPSite _site = new SPSite(spSiteURL)) { using (SPWeb _web = _site.OpenWeb()) { ...


1

The workflow will run for each item that meets the retention policy. When the timer jobs process the information and finds an item that is to expire, it will do what ever is specified as per the policy. If is to move it to the recycle bin, it moves all matching items to the recycle bin. If it is run a workflow, it runs a workflow on each item. This process ...


0

For changing visual style, combining CSS and the :nth-child selector is likely to be the way to go. This isn't in JSGrid, but it also isn't javascript and won't break any scripts.


2

Check this link: http://www.stuartroberts.net/index.php/2014/03/21/set-title-field-document-upload/ It just has solved the same problem for me. Basically it says that you have to use vti_title as name of the field, or use Item.Title property. About why it changed, I have no idea, maybe it was a SharePoint update or something.


1

Alternatively you could connect a Filter Web Part to a View of your Document library. Ref; https://support.office.com/en-us/article/Connect-a-Filter-Web-Part-to-a-List-View-Web-Part-4F3F6C10-0A1B-479D-8B4D-C4F1BF49BB3F


1

This control passes filter parameters to a list view. What is it supposed to do on random wiki-page? It's somewhat understandable if your wikipage contains a webpart that displays document library where MMS navigation is active (list view). An approach to the closest you can get it to work is described in ...


2

Farm solutions are only unavailable if SharePoint Online is a consideration. SharePoint 2016 continues to fully support not only custom Timer Jobs, but Full Trust Code Solutions, as well. I feel that FTC solutions should be used when and where appropriate for customers who continue to use SharePoint On-Prem. If you can find alternative solutions that do not ...


3

It is not entirely good practice. Problem is that you return list items in an instance of SPListItemCollection that contains items from SPWeb and SPSite that have been disposed (as the using closes). While it may work for basic field values, I don't recommend doing it like that as you will run into issues with some fields or properties. Perhaps you could do ...


1

If coding is option, Then you can create a timer job or console application and then schedule it to run daily. It will check whether today is review date and update the status accordingly. The code will be something like below using (SPSite site = new SPSite("Your site URL")) { using (SPWeb myweb = site.OpenWeb()) { SPList olist = ...


0

I'm not too sure about the question. If you mean something like auto-filling the label with the current user, you can request the current user object which has information like email, display name, log in name, etc. Check out SP.ClientContext to do this using client-side scripting. Check out ...


1

I would suggest a timer job or a console application to handle this. Pausing until a date won't have a huge performance impact as the workflow gets serialized to the database until it is time to do something. This big problem is that if that date changes, it doesn't affect the workflow that is currently running on the item. We have converted several ...


1

Using a workflow, you can set an action to Pause Until Date. In the date field, use your Review Date or a variable that is set to Review Date. Basic workflow logic: Pause Until Review Date If Review Status = New Set Review Status = Review Needed Little more info on the topic: "Pause until Date" workflows unable to handle changing ...


2

The Site Collection Feature Document ID Services, when activated generates a Unique ID for a Document. The format of this ID is something like PNR6U3ASXZE2-1206519163-68. In your question you have specified a URL in which you are passing a query string value document_id. I am not sure what value you get in it, and how you get it? I am sure about 2 things ...


0

I would highly suggest using CamlDesigner. I don't want to go through your caml query because your formatting is horrendous. Please clean that up if you want us to look at it. Here is an example Caml Query i made with CamlDesigner on a random list <Where> <And> <Or> <And> <Eq> ...


0

Try to replace <UserID /> tag by UserID number (int). Moreover, if you want to ensure that your query is correct, check the server response: if you receive a 400 Bad Request HTTP Error, then it's very probable that your query is malformed. If the answer is 200 OK, then you should check the rest of the code.


0

You could use the XmlReader class: https://msdn.microsoft.com/en-us/library/system.xml.xmlreader%28v=vs.95%29.aspx or the XmlDocument class (my preference): https://msdn.microsoft.com/en-us/library/system.xml.xmldocument.loadxml%28v=vs.110%29.aspx You'd do something like: XmlDocument doc = new XmlDocument(); doc.LoadXml(mobjView.Query); XmlNodeList ...


0

Solved! Trouble in JS for cross-site REST-query located in global.asax. This JS get User-agent from request header and replace request header in all query. Web application not send user-agent in request header and JS crash.


0

I did it on C# with this below code SPList lst = web.Lists[properties.ListItem["Name"].ToString()]; SPFolder folder = web.Folders[lst.RootFolder.Url]; folder.MoveTo(properties.AfterProperties["Nickname"].ToString());


0

You can try this to change the URL: Add-PSSnapin Microsoft.SharePoint.PowerShell –erroraction SilentlyContinue $libOriginalUrl = "/Lists/YourLibName1"; $libNewUrl = "/YourLibName2"; $web = Get-SPWeb -Identity http://.... $lib = $web.GetList($web.Url + $libOriginalUrl) $rootFolder = $lib.RootFolder; $rootFolder.MoveTo($web.Url + $libNewUrl)


0

You can't get a subsite using ClientContext constructor. Try this: public string testRest() { try { // In constructor, put only the Site URL ClientContext context = new ClientContext(new Uri(@"http://sharepointRemoteServer/")); context.AuthenticationMode = ClientAuthenticationMode.Default; context.Credentials = ...


1

Blog posts will always have a Content Type Id starting with 0x0110, so this query will show you all blog posts: keywordQuery.QueryText = "ContentTypeId:0x0110*"; And this query will also let you filter by date - in this example, only display blog posts from 2016-01-01: keywordQuery.QueryText = "ContentTypeId:0x0110* Created>=2016-01-01"; By default ...


0

You're most probably facing what is known as a "double-hop" issue: Your client user connects and authenticate as himself against the Web app (through Windows NTLM protocol, that requires the client to know her/his password). The Web app uses impersonation. It means the code runs under the user's identity. With your context.Credentials = ...


0

I had the same symptoms on a SharePoint 2013 On Premise SP1 and October 2015 CU problem was I ensured the user using the windows login name: domain\username e.g: var user = clientContext.Web.EnsureUser("dev\administrator"); with this user, IsSiteAdmin returned False (he was definitely directly added to site collection admins) also with this user I did ...


0

Make sure you have read permissions on the site. If you already have them, then try to assign yourself "colaborate" permissions.


0

You can disable this rule using powershell. I have also disabled the rule for page file being larger than ram. $spCentalAdminWebApp= Get-SPWebApplication -IncludeCentralAdministration |? {$_.IsAdministrationWebApplication -eq $true} $spCentalAdminSite = ($spCentalAdminWebApp | Get-SPSite |? {$_.Url -notlike '*help'}).Rootweb ...


1

Turned out I've handled the operation a little too late because it works only when handling the event ItemFileMoving not ItemFileMoved. It's as simple as that: properties.Cancel = true; because the ErrorMessage won't be displayed in Explorer. The default Windows error message looks like this:


1

There is one notable addition to WAS on SharePoint 2013, which is the instant conversions versus the timer job-based conversions. More information can be found at http://social.technet.microsoft.com/wiki/contents/articles/15731.sharepoint-2013-new-features-in-word-automation-services.aspx.


1

An issue is solved! I tried the same WF at a site level (previously it was at a list level) and it completed without any problems. After that, I recreated a list and bound the WF to it. Now I suppose that the issue was related to some permissions on the original list. Thanx! Alexander


0

Using the SharePoint Rest API, you can set the permissions of the list/library, item, or folder. This links will guide you through the process. How to: set unique permissions for a File via REST: Manage File permissions using REST API Users, groups, and roles REST API reference: https://msdn.microsoft.com/en-us/library/office/dn531432.aspx If you are ...


4

How you can do this: Open your list and open the list settings Select the column "Plan start date" Under Validation setting type in the below formula : [Plan start date]<=[Plan end date] This help you to validate your dates before saving them. Hope this helps !


1

Content Types work in that way and propagating changes is a good way to apply changes to all inheriting objects (List/Libraries). You should not afraid because it requires higher privileges to do so, so only responsible person would be doing that. You should wisely set up permission that will ensure only responsible persons can make necessary changes. ...


1

I've just worked through your scenario in SharePoint online. Did 1. through to 4. Description is hidden in my custom Issue list form. Then I edited the native Issue CT and made the Description field required. clicked "Yes" to update all content types inheriting from this type opened a new issue in my custom Issue list The previously hidden Description ...


0

If you return a column containing Site Name within it, you can then: <GroupBy><FieldRef Name="**SiteNameField**" /></GroupBy> Hope this helps


0

No. there won't be any impact on your SP infrastructure. VS 2012 ULTIMATE/PROFESSIONAL is just a tool/IDE to enable a smooth SharePoint development experience. Using VS Versions, you would be developing SP solutions as packages [.wsp files], and using PowerShell or stsadm command line tools you would deploy on the SharePoint farm.Without VS, you wont be ...


1

Try This, Declare a Client context ctx and get your list/library name: RoleDefinition roleDef = ctx.Web.RoleDefinitions.GetByType(RoleType.Reader); RoleDefinitionBindingCollection roleDefBinding = new RoleDefinitionBindingCollection( ctx ); ctx.ExecuteQuery(); roleDefBinding.Add( roleDef ); CamlQuery query; query = ...


0

Create a Button Create a dictionary like below: private Dictionary<string, object> EnumerateFieldControls() { Dictionary<string, object> fieldValues = new Dictionary<string, object>(); try { foreach (Control validator in _listFieldIterator.ItemContext.FormContext.FieldControlCollection) ...


0

SharePoint doesn't provide a facility for securing individual columns, I mean OOTB. The lowest level SharePoint operates at is security on a whole list item. We can modify the NewForm.aspx or EditForm.aspx or DispForm.aspx to restrict certain columns to be read only or hide by checking permissions with the help of ECMA script and JQuery. Another possible ...


0

Did you tried to debug your code. Your code has SPSite site = new SPSite(SPContext.Current.Web.Url); This line should not work in Timer Job, Since the Timer Jobs runs as a background process it won't take any SharePoint Context from SPContext.Current.Web.Url; Please create Property Bags in your Web Application or you can add App Settings in your ...


0

we retract then solution and redeploy the solution. Then, it works well. We think that we had changed the link tohttpsafter we deploy the solution in production server. So this solution does not update with the link https.


1

You don't need to pass count as a parameter as you can get it from queries Inside the method RecursiveNestedOr itself (also, rename parameter query as queries). Otherwise, your recursion looks fine to me. Here's how I'd "simplified" it, using LINQ (add using System.Linq): public static string RecursiveNestedOr(IEnumerable<string> queries) { ...


0

There's a real probability the problem comes from a mis-configured AAM. If you browse your site with https:// but https is not registered in AAM (or is registered as an internal URL of the default zone), then all links in the page will be replaces by SharePoint by the public URL of the default zone. Check your AMM (in Central Administration, "Application ...



Top 50 recent answers are included