New answers tagged

0

all that was mentioned by Mike are valid tips and should be deferentially checked and considered other thing I would check which may have a huge performance impact is the way You query items from SharePoint. Using SPQuery and GetItems() method is not the best way. First of all it does not provide any caching and returns SPListItem objects that have all ...


0

404 (not found) can sometimes be related to permissions. Rather than say "access denied", and give away the fact that something exists, it just says "I dunno what you're talking about, nobody with that name here". Point being, SharePoint is making a request to your azure svc, which means it needs access to call the azure svc. I'm not sure what "account" it'...


0

I just have the perfect solution for you, it's called "Cascading Dropdown" ! Please refer to Mr Shane Young which i find him very professional guy, and here the link: PowerApps Cascading Dropdown, here you will find exactly what you want and more ! Good luck.


0

Chelsea_MSFT has the right answer, but just a couple other points: You mention "have to enter". Just pointing out that fields have a required property that can be set exactly the same way, so you can set fields to be conditionally required. PowerApps, for an inexplicable reason, runs these rules in design view while you're building your form. This means ...


2

In PowerApps managed metadata column shows up as a drop-down menu and There is no (out of the box) way to show the "tree structure" of terms. Source: PowerApps and managed metadata. Multi-valued managed metadata columns are fully supported in PowerApps. Source: Tips and Tricks for multiselect controls with advanced tagging options.


1

It is supported in PowerApps. I’ve tested in a simple list with 5 single line of text fields, named A~E. For example, when I check the Checkbox control, the field A and B will be invisible and be replaced by fields C~E. Please see the steps below: Select Data Card for field A and switch to “Visible” under properties. Type If(Checkbox2.Value=false,true,...


1

I've faced a similar scenario myself; I used document sets (yet more info here) to create a document set and a handful of sub-folders. It sounds rather similar to what you are doing. In a nutshell: editing a List item then triggers a workflow to create a document set (and sub-folders) in a Document Library. Here's my post which makes use of Cameron Dwyer'...


1

Several things to try: Instead of foreach loops, switch them out for 'for' loops, they have been proven to be faster: https://www.c-sharpcorner.com/article/for-vs-foreach-in-c-sharp/ I'd look into concatenation of string more efficiently: https://stackoverflow.com/questions/21078/most-efficient-way-to-concatenate-strings I'd replace all instances of ...


0

Deleting the Task would be as simple as: SPWeb site = SPContext.Current.Web; SPListItemCollection listItems = site.Lists["Tasks"].Items; SPListItem item = listItems.GetItemById(124); site.AllowUnsafeUpdates = true; listItems.Delete(item); The workflow history is associated with the Workflow Manager setting: https://docs.microsoft.com/en-us/archive/blogs/...


2

You need update folder metadata for the root folders after run the MoveTo method, modify the code as below. if (currentItem.ContentType.Name.ToLower().Contains("project")) { Console.WriteLine(currentItem["ID"]); SPFolder folder = omsWeb.GetFolder(omsWeb.ServerRelativeUrl + "/Shared Documents/"+currentItem["ID"].ToString()); var modified = folder....


0

It is possible to move documents from one document library to another library using server object model. Use the method MoveToof SPFile to move documents from source to destination. Refer this http://msdn.microsoft.com/en-us/library/ms468280.aspx. Preserving the metadata Make sure that source and destination libraries have same set of fields/content types. ...


0

Yes, it works (in hindsight: why shouldn't it). I tried it with Microsoft.Office.Interop.Excel version 16 (not available via NuGet but available in the COM references when Excel 2016 or greater is installed). Without any special programming, coauthoring can be used after opening the shared workbook (.xlsx on Sharepoint, just use the http path as argument in ...


0

Server Side Object Model: 1) Supported only in SharePoint On Premises. 2) Traditional coding approach specially for those with ASP.NET background. 3) Migration from version to version or from On Premises to Online require the code to be modified or re written. 4) Better to use for Security critical applications. 5) More optimized when it comes to complex ...


1

You can parse this url with regular expressions. This code should work with your example url: string s = "http://rvsp2019/sites/firstsite/_api/web/GetList(@v1)/RenderExtendedListFormData(itemId=16,formId=%27editform%27,mode=%272%27,options=7)?@v1=%27%2Fsites%2Ffirstsite%2FDL%27"; Match match = Regex.Match(s, @"itemid=(\d+)",RegexOptions.IgnoreCase); if (...


0

Here is the C# code using this we can add or remove user from SharePoint group: Using C# SSOM - server object model SPWebApplication g_WebApp; SPWeb g_Web; try { SPSecurity.RunWithElevatedPrivileges(delegate() { SPSite site = new SPSite(“<siteUrl>”); //...


2

Try debugging your remote event receiver locally as given in the below article: Remote Event Receivers – you’re all doing it wrong. In order to use this you will need the following things. Node.JS and ngrok. Then Start ngrok service and create a RER which points to your ngrok service, instead of real URL. Then test your RER locally in Visual Studio. ...


0

Per my test, when we create a new enterprise wiki page in SharePoint online, by design the version of this page is 2.0 instead of 3.0. As the below picture shows: I think that's why the workflow doew not get fired. As a workaround, you could delete the condition If current Item: Version not equals 2.0 in your workflow.


0

We can add ViewFields in SPQuery to solve this issue. The following code for your reference. using (SPSite site = new SPSite("http://sp2013/sites/team")) { using (SPWeb web = site.OpenWeb()) { SPList spList = web.Lists.TryGetList("Workflow Tasks"); SPQuery qry = new SPQuery(); qry.Query = @"<Where><Eq><FieldRef ...


1

I suggest to use SPListItemCollection class instead of DataTable. Please try: using (SPSite site = new SPSite("YOUR SITE URL")) using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists.TryGetList("Workflow Tasks"); var query = new SPQuery { Query = String.Format("<Where><Eq><FieldRef Name='{0}' /><Value Type='...


1

Changing the Framework type did the trick. I am using VS 2019 (16.4.2) and my target framework was .net core 2.1. It was constantly giving 400 bad request errors. The same code when translated to Powershell was working perfectly fine. When the target framework was changed to .net framework 4.7.2 (or 4.5), things worked perfectly. Try making a console ...


0

By far the best example with sample code: https://developer.microsoft.com/en-us/office/blogs/new-sharepoint-csom-version-released-for-Office-365-september-2017/


1

Please refer the following code snippet to create publishing page and set multi-value managed metadata based on another item: using System; using System.Collections.Generic; using System.Linq; using Microsoft.SharePoint.Client; using Microsoft.SharePoint.Client.Publishing; using Microsoft.SharePoint.Client.Taxonomy; public static string ...


1

I suggest you check if the exists page ServerRelativeUrl is right, and make sure the "Standard" field exists in the Pages library. The following code for your reference. string siteUrl = "https://tenant.sharepoint.com/sites/team"; string userName = "test@tenant.onmicrosoft.com"; string password = "xxx"; string newPageName = "new1227.aspx"; var ...


0

There is an error in your CAML query. Try using Text instead of String. So this: camlQuery4.ViewXml = "<View><Query><Where><Eq><FieldRef Name='Title'/>" + "<Value Type='String'>Basic Page</Value></Eq></Where></Query><RowLimit>1</RowLimit></View>"; Should become: camlQuery4....


1

Try using below query in ViewXml (Use internal name of Processed field): <View> <Query> <Where> <Contains> <FieldRef Name='Processed'/><Value Type='Text'>Not Processed</Value> </Contains> </Where> </Query> </View> You can also ...


1

Use<Neq> </Neq> instead: <View> <Query> <Where><And><Neq><FieldRef Name='ResultMessage' /><Value Type='Text'>success</Value></Neq><Neq><FieldRef Name='ResultMessage' /><Value Type='Text'>fail</Value></Neq></And></Where> </...


2

How I can specify does not contain inside CAML? As a short answer, Unfortunately, you CAN'T. There isn't <NOT Contain> element or any equivalent for <NOT Contain> in Query schema elements Workarounds You can get the "<FieldRef Name='ResultMessage'/>" and perform logical comparing like if (!string.Contains("fail") && !string....


5

In case, the District is a single line of text, try the below code using (SPSite site = new SPSite("SiteURL")) { using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists["ListName"]; SPQuery query = new SPQuery(); query.Query = "<View><ViewFields><FieldRef Name='District'/></ViewFields></View&...


Top 50 recent answers are included