New answers tagged

0

Have you tried to use the ParentFolderId instead? Discussions have two different content types, Discussion for a new topic posted and Message for a reply to that topic. The ID for the original discussion (topic) post is the column "ID" on that item. But the reply messages store this same number in the "Parent Folder ID" column.


0

This is the code i use to get videos info from a "Asset Library", maybe this can help you. I don't know how to get the preview pic but should be right there: getDataFormVideosList:function(next){ var camlQuery = new SP.CamlQuery(); camlQuery.set_viewXml('<View>' + '<ViewFields>' + ...


0

You need to add the the microsoft.sharepoint.client dll as reference in your project and then import (using Microsoft.SharePoint), then you can use all the predefined SharePoint classed in your class without any issue. Below link details all the classes that are available under the namespace. ...


2

You should refer this link once. This post contains the code for authenticating with your SharePoint Online and upload a file into the given library. class Program { static void Main(string[] args) { using (ClientContext clientContext = new ClientContext("https://xxxx.sharepoint.com/sites/SiteName")) { ...


2

Document sets are just "fanzy" folders, so you have to use scope RecursiveAll. query.ViewXml = "<View Scope=\"RecursiveAll\" /> "; Or simply use the CreateAllItemsQuery that sets the same caml markup: CamlQuery query = CamlQuery.CreateAllItemsQuery();


0

[SharePoint Online] I've had this problem too, it was not the App principal that was returned but the site admin as current user. The problem for me was that I had not yet added this to the app manifest: <AppPermissionRequests AllowAppOnlyPolicy="true"> <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" ...


2

Query should be like camlQuery.ViewXml = "<View><Query><Where><Eq><FieldRef Name='Title' /><Value Type='Text'>Test1</Value></Eq></Where></Query></View>";


0

Found the answer. If you want to retrieve all list items just don't put anything for the CamlQuery. private static ListItemCollection GetListItems(List docLibrary, ClientContext ctx) { CamlQuery query = new CamlQuery(); var listItems = docLibrary.GetItems(query); ctx.Load(listItems); ...


2

On your SPQuery object, you can set the scope in the ViewAttributes property, as documented here: https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.spquery.viewattributes.aspx ... SPQuery spQuery_temp = new SPQuery(); spQuery_temp.Query = "<OrderBy><FieldRef Name='Modified' Ascending='False' /></OrderBy>"; ...


2

try this one: SPSite site = SPContext.Current.Site; SPWeb web = SPContext.Current.Web; SPList list = web.Lists[“Shared Documents”]; SPQuery query = new SPQuery(); //Condition to check the item type is folder or not query.Query = “<Where><Eq><FieldRef Name=’FSObjType’/><Value ...


1

I don't think there is any official documentation about that. After decompiling DLLs, this is what I found : Microsoft.SharePoint.Navigation.SPNavigationNode.Properties are coming from SPRequest.GetNavigationNodeProperties The latter gets those properties from an internal class, which seems to point to OWSSRV.dll that I cannot decompile. See also : ...


1

Yes, it is possible to create custom HTML, Javascript and CSS in your SharePoint site. A tool called SharePoint Designer is also available that shall help you to perform this. It is suggested that rather than this IDE it would better if you would use SharePoint Designer as it is designed for SharePoint specifically. You would be able to download this ...


2

You can use a couple of approaches: Save last item id in SPList properties and then retrieve the value next time you're adding an item: //set - after setting all field values and updating the item itemAdd.Update(); wayList.RootFolder.SetProperty("LastItemID", itemAdd.ID); //you need AddProperty if it doesn't exist //get //then subtract 1 if needed var ...


2

You can perform this activity using CAML query with the below logic Get the list items in descending order Set row limit as one and retrive the record CAML Query: <View><Query><OrderBy><FieldRef Name='ID' Ascending='False'/></OrderBy> <Where> <Eq> <FieldRef Name='Title' /> <Value ...


0

InfoPath rules don't do the "Else" part. Create a rule for each outcome and place them on the button or the field change event. If you are hitting the limit of what InfoPath supports, then you may consider changing your technique altogether. Create a SharePoint list with three fields, i.e. Field1, Field2 and ResultField or use an XML file with that ...


0

Click on the project name in solution explorer and press F4 key, It will open project property. Go to site Url property and then erase old property and write your office 365 base url like https://xyz.sharepoint.com press tab and save solution, it will open new authentication window. Enter credentials and click on log in.


0

Actually, the snippet you posted doesn't have any direct dependency to the usage of a specific site definition/template. Instead, it requires the presence of a "Category" list with a specific structure somewhere in the site collection (notice the ".../_vti_bin/ListData.svc/Categories?$orderby=ParentCategoryId" url in the $.getJSON(...) call - this should be ...


0

I was facing the exact same issue and resolved it by setting ReplaceContent="true" in the element.xml file of the module as below <File Path="MasterPageModule\MyMasterPage.master" Url="MyMasterPage.master" Type="GhostableInLibrary" ReplaceContent="TRUE" Level="Published"/> Also you can get it here ...


1

Client side rendering or code to set fields won't work in datagrid view. I recommend using a workflow. Using the Wait For action (run workflow on create) is a better option than checking the status every time an item is edited.


0

A simple workflow could accomplish this. May need to add some additional logic to prevent due date from being set again if the item is going to be modified frequently.


3

For client-side implementation, use JSLink to override field rendering. You can also add your javascript dropdown change handler to PostRender function of JSLink. Using server side, you can use event receiver to calculate Due Date on item created and updated events.


0

Adding the ~ is what got things working <PageParserPaths> <PageParserPath VirtualPath="~/SitePages/DataDictionary/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true"/> <PageParserPath VirtualPath="~/sites/RDS/SitePages/DataDictionary/*" CompilationMode="Always" AllowServerSideScript="true" ...


1

You can make a custom editform.aspx via SharePoint Designer to make the end date "read only". You have to change the ControlMode from "Edit" to "Display". There are also other ways with jQuery, JS or Powershell. How to create a new, display or edit form is shown here: https://afrait.com/blog/custom-new-edit-or-display-form-in-4-steps-en/ You can set the ...


2

If you go to Site Settings > Search Settings > Send queries to a custom results page URL, you can send your results to the Search Center using the Search Center URL property, thus: {SearchCenterURL}/results.aspx EDIT I believe the properties are as follows: Site Collection Search Center = SRCH_ENH_FTR_URL Site Collection Search Dropdown Mode = ...


3

You've not selected the correct project template. That error is shown when you try to create a On-Premises SharePoint 2013 solution on a non-SharePoint development environment. To create solutions for SharePoint Online, you should create a project using the App for SharePoint project template.


0

We had this issue on our farm around the year ago.We bring MSFT folks jump in and finally a very easy solution. Restart the SharePoint Timer Service and Admin Service on all the server in the farm. So that old dll should recycle.


0

Use SPWeb.GetUserEffectivePermissions this will return which permissions the user has.


1

find below mentioned tags in SharePoint master page <div class="s4-lp s4-toplinks"> please don't touch the code in-between these two tags. Put style="display:none;" to that DIV tag like below. <div class="s4-lp s4-toplinks" style="display:none;"> Put your static menu code above the hidden html DIV tag E.g. Here is the sample code for top ...


0

This is the code I've got so far: Web web = context.Web; context.Load(web, w => w.Url); List list = web.Lists.GetByTitle(listName); context.Load(list, l => l.Id); var items = list.GetItems(createGetDocSetQuery(query)); context.Load(items, folders => folders.Include( folder => folder["ID"], folder => folder["ServerUrl"], folder ...


0

There are few WebParts & Workarounds for Discussion board available online as mentioned below Sharepoint Discussion Rollup Web Part Social Squared 2010 Microblog/Chat Web Part Intranet discussion list with SharePoint 2013


2

Try this method: Without attachment using SPUtility. private Boolean SendEmail() { try { bool flag = false; SPSecurity.RunWithElevatedPrivileges( delegate() { using (SPSite site = new SPSite( SPContext.Current.Site.ID, SPContext.Current.Site.Zone)) { using (SPWeb web = ...


2

Your website is running outside of SharePoint and as such does not have SharePoint context. It knows nothing about anything going in SharePoint. I f you instantiate a new SPSite object from outside SharePoint in another site (running on the same server), whatever user the AppPool (or if impersonated, the user opening the webforms site), the current user ...


3

Your code is fine. I would not attempt to circumvent the problem as it may be telling you that there is in fact something wrong with your setup. There are many reports (I've experienced this myself) where the User Profile Service is throwing exceptions and needs to be brought back to full health. e.g. Go to Central Admin -> Manage Web Applications. ...


2

You could use try catch. If it always crashes. Not the cleanest way of handling it but this should do it. But I would call this a quickfix. SPSecurity.RunWithElevatedPrivileges(delegate() { using (SPSite site = new SPSite(SPContext.Current.Site.Url)) { SPServiceContext ctx = SPServiceContext.GetContext(site); try { ...


0

while (group.Users.Count > 0) { group.Users.Remove(group.Users[0]); } This should remove all the users in the group for CSOM and SSOM.


1

Let's see how the page should work. When you select a web part in the Add Web Part gallery, a preview of the web part is displayed on the right panel (it would appear where the error message is). This means that SharePoint has to render a part of the web part to be able to display such preview - this is why the OnInit method is run. As for the .IsPostBack ...


0

I managed to solve this by adding SequenceNumber and Synchronization in the Elements.xml file of the event receiver: <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <Receivers ListUrl="Lists/members"> <Receiver> <Name>MembersItemUpdated</Name> ...


1

If you run your code under elevated privileges, user can see everything but then you need security trim(depends on your security rules) parent site. If you just show tree, I might be OK but if user clicks tree node and if user runs some processes based on this click, you need to security trim to your tree and you should be careful that because easily you can ...


1

Inspired by Arsalan Adam Khatri's answer I found a solution: 1) First create a page to handle the redirection: LayoutPageRedirect.aspx <html> <head> <META http-equiv="refresh" content="0;URL=./_layouts/folder/HomePageCustom.aspx"> </head> </html> 2) Then create a module to deploy this file <?xml version="1.0" ...


1

You can create a delegate control that would check if the current page is welcome page of the site. If Yes, then it would redirect to your application page using C# Response.Redirect(SPContext.Current.Web.Url + "/_layouts/YourApplicationPage.aspx"); JavaScript window.location.href = _spPageContextInfo.webAbsoluteUrl + ...


2

You cannot set Application pages as Welcome Page, only Site pages located either at the root web or from a Pages library. But you can use a Redirect Page or redirection from your home page to layouts page. Please refer to Possible to have the default landing page of my Sharepoint Site be an applicaiton page? How to Set an Application Page as a default ...


1

The only tricky part for accessing SharePoint Online from the Client Object Model will be the authentication. There is no direct method of authenticating with SharePoint Online from the CSOM so Microsoft has released a work around. You can find the details and code here: ...


1

<script type="text/javascript" src="../../JSLibrary/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="../../JSLibrary/jquery.SPServices-0.4.8.min.js"></script> <script type="text/javascript"> $(document).ready(function () { var managerName; var userName = ...


2

(I must say it is embarrassing to admit this) I have (partially) done this with REST. I had used Newtonsoft.Json to parse the responses and HttpWebRequests to interact with the REST API. (I think you would be able to work with Atom using System.Xml as well.) However I am not aware of a single library doing the process end-to-end.


0

Start with jquery data tables along with CSOM/REST API calls. The below link should get you started. All the best with your work. Rest and datatables


0

You probably will not see any difference. But if you need to update your solutions, or add something new... you will see that some advanced features (Like test automation stuff, as said by klewgenius) will be missing. ANyway, for basic sharepoint development, considering webparts, event receivers, even workflows... you will see no changes. Specially ...


0

Commom features/images/scripts/styles should always be set to let NT Authority\Autheticated users read. Imagine that some resources referenced in your masterpage are restricted. Then, everybody will get tons of "Access Denied". About the "Site Pages" issue: Your site pages are referencing something different? Like custom webparts calling CSS/JS or ...


1

Microsoft Fakes doesn't work on VS Professional. Consider that if you are doing Unit Testing and using SPEmulators you will need to use VS Ultimate/Premium.


1

SPGroup.ContainsCurrentUser() is also an option. You can get the HR group as usual and check if the HR group contains the current user. Then, it's just about hide/disable that button.


1

You can do it by code also: if (SPContext.Current.Web.CurrentUser.Groups.Cast<SPGroup>().Any(g => g.Name == "hr Group")) { show button } else { hide button }



Top 50 recent answers are included