Tuesday, July 13, 2021

Power Automate (Flow): Limit Columns by View

How to use the "Limit Columns by View"

App: Power Automate 

You may have tried to use the "Limit Columns by View" field and received something similar to: 

Error code: '400', Message: 'List View Not Found clientRequestId: 422C5F17-1C1B-46CD-AE5E-E3E2865D89D5 serviceRequestId: 422c5f17-1c1b-46cd-ae5e-e3e2865d89d5'. Client request id: '422C5F17-1C1B-46CD-AE5E-E3E2865D89D5'

Solution: You can't use the view name. You need to get the view ID (GUID).

  1. Browse to your list.
  2. Go to the view.
  3. Click on the view name.
  4. Click on "Edit current view".
  5. In the address bar you'll see something similar to: sharepoint.com/sites/dev/_layouts/15/ViewEdit.aspx?View=%7B8676E46D-E1C7-4A70-N2N2-BC7289A06F75%7D&List=%7BF413A77B-2EAF-4560-AAEE-EA904070318C%7D
  6. I've highlighted the part that you need to find in your URL. It's between the "View=%7B" and "%7D&List". This is the ID of the View. This is what you need for the "Limit Columns by View" field.



Tuesday, February 5, 2019

“The installation of this package failed” while installing a SharePoint update

Symptom: If you get the message “The installation of this package failed” while trying to install a SharePoint update.

Potential resolution: Check that you have enough hard drive space for the patch to extract and run. 

Tuesday, May 2, 2017

Opening a form as a Site Member gives: "Sorry, you don't have access to this page"

Symptom: 
You have a SharePoint list and the user reporting the issue is a Site Member. When the user tries to open a list item in view mode they are redirected to a page with the message: "Sorry, you don't have access to this page"

Issue: 
The issue I had was that one of the fields in the list was a person field. This field restricted the choice of people to a SharePoint Group. On checking this SharePoint security group. I found that the setting for this group "Who can view the membership of the group" was set to "Group Members".

Resolution:
Once I changed the "Who can view the membership of the group" to "Everyone" everything worked as expected.

Tuesday, April 25, 2017

Nintex Forms: Birthday Date Picker Year

Issue: By default the date picker will display the years as ±10 years. This is not suitable for a Date of Birth date picker. 

Fix:


  1. Edit the form in Nintex Forms.
  2. Double click the Date picker field.
  3. Open up the "Advanced" section.
  4. For setting "Store Client ID in JavaScript variable" change to "Yes".
  5. An additional field will be visible called "Client ID JavaScript variable name". Provide it a name. In my example it's called "birthdayControl".
  6. Click Save. Dialog will close.
  7. Click "NINTEX FORMS" on the ribbon.
  8. Click "Settings"
  9. Open up the "Custom JavaScript" section of the "Settings - Form" dialog.
  10. Add the following:
    NWF$(document).ready(function(){
          NWF$('#'+birthdayControl).datepicker('option',{yearRange:'-80:-0'});
    });
  11. Change the variables to suit your situation:
    1. birthdayControl: Client ID Variable set in step 5 above.
    2. -80: How many years back you want to display in the date picker.
    3. -0:How many years forward you want to display in the date picker.
  12. Click "Save". Dialog will close.
  13. Publish the form.
  14. Your specific date control should now show a more appropriate year selection for Date of Birth.

Tuesday, July 5, 2016

SharePoint 2013: Internet Information Services is not installed?

Symptoms:
While attempting to run the "SharePoint Products Configuration Wizard" for SharePoint 2013. You get a dialog which states:
"Internet Information Services is not installed. You must have Internet Information Services installed in order to use the SharePoint Products Configuration Wizard."
But your sure IIS is installed.

Issue:
Some IIS dependent services might not be running.

Fix:
Open up the Services Management Console (Press the Windows key. Then start typing Services. Open "Services")
Ensure the following services are running:
IIS Admin Service
World Wide Web Publishing Service

Sunday, August 9, 2015

Android Google widget: Searching just apps on the phone/device

Long version:
I recently upgraded from a Nexus 5 to a Samsung Galaxy S6. One thing that bugged me from this change was the way the Google search widget behaved. The Nexus 5 would present content on the device as quick results as you type the search phrase. This is what I used to quickly find apps and open them. On the S6 it would search the web, music, contacts, books and apps.

Short version:
To configure the Google search gadget to present apps as quick results:
Open up the apps tray.
Open up the Google folder and/or find "Google Settings".
Open up "Search & Now".
Open up "Phone Search".
Now you can select what the Google gadget searches.

I've only got "Apps" and "Contacts" selected. But it's up to you how you use this widget

Monday, February 3, 2014

SharePoint 2013: "Sorry, we're having trouble reaching the server"

Trying to add users to SharePoint groups.

When I type in a name I get the following message: "Sorry, we're having trouble reaching the server"

I had been tinkering with the web app directly in IIS (don't try this at home) and I disabled "Anonymous access". 

Apparently this is necessary for SharePoint to function. So don't mess with it.

Wednesday, November 20, 2013

SharePoint field + XML = Blank field

Intro:
I've been tasked with storing the contents of an RSS feed (xml) to SharePoint via a Custom Timer Job.

When I tried to run the following code. I simply got a blank field for the "RSSContents" field of the new item.

using (System.Net.WebClient client = new System.Net.WebClient())
{
using (Stream data = client.OpenRead("http://www.bom.gov.au/fwo/IDZ00059.warnings_vic.xml"))
{
using (StreamReader reader = new StreamReader(data))
{
    SPWebApplication webApp = this.Parent as SPWebApplication;
    SPList list = webApp.Sites[0].RootWeb.Lists["TimerTest"];
    SPListItem newListItem = list.Items.Add();
    newListItem["Title"] = DateTime.Now.ToString();
    string s = reader.ReadToEnd();
    newListItem["RSSContents"] = s;
    newListItem.Update();
}
}
}

Workaround:
Add HtmlEncode into the mix:
using (System.Net.WebClient client = new System.Net.WebClient())
{
using (Stream data = client.OpenRead("http://www.bom.gov.au/fwo/IDZ00059.warnings_vic.xml"))
{
using (StreamReader reader = new StreamReader(data))
{
    SPWebApplication webApp = this.Parent as SPWebApplication;
    SPList list = webApp.Sites[0].RootWeb.Lists["TimerTest"];
    SPListItem newListItem = list.Items.Add();
    newListItem["Title"] = DateTime.Now.ToString();
    string s = reader.ReadToEnd();
    s = WebUtility.HtmlEncode(s);
    newListItem["RSSContents"] = s;
    newListItem.Update();
}
}
}

I'm working in a SharePoint 2013 environment. So your results may vary. But I suspect this is the same across each of the different SharePoint versions. 

How to: Debug a timer job deployment?

Intro:
So I've been tasked with writing a Custom SharePoint timer job.
So I googled it up and I followed Andrew Connell's article
http://www.andrewconnell.com/Creating-Custom-SharePoint-Timer-Jobs

Symptoms:
After I made modifications to suit my needs I go and try to deploy it (by pressing F5). After which I get a very descriptive message:
Error occurred in deployment step 'Activate Features': Object reference not set to an instance of an object.
So I comment out every line of the "Activate Features" code and try to diagnose it. Breakpoints don't seem to work.

Workaround/Resolution:
Insert
System.Diagnostics.Debugger.Launch();
into your code and if all goes right Visual Studio will pick up the task of debugging your code.

SharePoint 2013: RemoteAppUrl is not specified.

Situation: I've built a Provider Hosted SharePoint 2013 app. It's been working happily until I went to "clean up the project". I made a couple of changes to the IIS Web App project properties and now when I try to deploy my app to SharePoint I get "RemoteAppUrl is not specified."
But it doesn't provide any clues as to how this can be fixed.

Fix:
In Solution Explorer.
Right click on the Web App and click Properties.
Open up the "Web" section.
Under Servers check "Apply server settings to all users (store in project file)".

Why?:
I believe if you have this unchecked Visual Studio won't set the "RemoteAppUrl" in the AppManifest.xml and thus the message.

 

Tuesday, October 8, 2013

jMeter 2.9 & SharePoint 2010

Intro:
So I was tasked to find the cheapest way to apply load onto a SharePoint environment. Found jMeter which lots of people raved about.

My sample SharePoint environment is:
Windows 2012 Standard
SharePoint 2013
JMeter 2.9

Symptoms/Issue:
So I created a simple load test to hit the default page of my site collection but all I got were 401s.
Response code: 401
Response message: Unauthorized
HTTP/1.1 401 Unauthorized

How to create a basic page request in JMeter for SharePoint:
  1. Download Java Runtime Environment: http://www.java.com/en/download/index.jsp
  2. Download JMeter: https://jmeter.apache.org/download_jmeter.cgi
  3. Extract JMeter.
  4. Run jmeter.bat from the bin folder.
  5. Right click Test Plan > Add > Threads (User) > Thread Group
  6. Right click on "Thread Group" > Add > Sampler > HTTP Request
  7. In the new HTTP Request you just added:
  8. Server Name or IP: uri of your site collection (without the http(s)). For example if the landing page of my site collection is: http://spdev/Pages/Default.aspx. You would just have spdev in this field.
  9. Port Number: can be left blank if using port 80.
  10. Implementation: Java <- this is the step I had to change to get this whole thing to work for me.
  11. Path: in this example I put /Pages/Default.aspx
  12. Right click on "Thread Group" > Add > View Results in Table (or View Results Tree).
  13. Now click: Run > Start (or Ctrl + R)


 

Sunday, October 6, 2013

SharePoint 2013: CSOM List Permissions in C#

Intro: I'm building a SharePoint 2013 provided hosted app. I had a requirement to retrieve permissions for the current user to a particular list. I want to enable/disable a checkbox depending on their ability to add/edit items in a particular SharePoint list. So I search around and find this:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.list.effectivebasepermissions.aspx
Unfortunately there's no sample in the above article and aren't any examples of how to use it anywhere on the web.

Issue: The EffectiveBasePermissions isn't loaded unless you specifically ask for it. This is the CSOM way.

Solution:
using (var clientContext = new ClientContext(hostWeb))
{
    Site site = clientContext.Site;
    clientContext.Load(site);
    clientContext.ExecuteQuery();

    Web web = site.OpenWeb("Name of spweb");
    clientContext.Load(web);
    clientContext.ExecuteQuery();

    List list = web.Lists.GetByTitle("Name of List");
    clientContext.Load(list, l => l.EffectiveBasePermissions); 
    clientContext.ExecuteQuery();

    bool myAddPermission = list.EffectiveBasePermissions.Has(PermissionKind.AddListItems);
    bool myEditPermission = list.EffectiveBasePermissions.Has(PermissionKind.EditListItems);
}

The code above will more than likely get the permission of the IIS App pool running your app. You may need to change the credentials in which the clientContext is running:
clientContext.Credentials = new NetworkCredential();

Explanation:
When writing server side code we can get all the data for the Web or list. Because we can afford to. But when we use CSOM we want to minimise the amount of data going back and forth. So the clientContext won't have the "EffectiveBasePermissions" unless you tell it to.

Wednesday, July 24, 2013

BigPond Usage Meter

Ok so this isn't quite SharePoint related. But for those in Australia using Bigpond. Here's a great little Windows gadget which displays your usage:
http://www.gm2k.net/gadgets/bpusagemeter/

I'm using it to view my 100mbps cable connection usage.

Loving cable.

Thursday, February 16, 2012

SharePoint: Document Library as a Lookup field source

Went to create a Lookup field in a list to point at a document in a document library. Sounds pretty straight forward? Unfortunately not.

Document librarys use Name is the main column. It still contains the Title column but this column isn't required. When people upload files they will more than likely leave Title blank.

Move along to the Lookup field creation. You only have the option to pick:
Title
ID
Created
Modified
Copy Source
Version

Do you see the issue? The only good field to pick here is the Title field. But if all the Titles are blank you won't have anything to choose from?

At this stage the only workaround I can think of is to create a workflow which fills in blank Title fields on creation and on change. Messy but will fix this particular issue.

Good luck.

Thursday, January 5, 2012

SharePoint 2010: Master page and sub team sites

Had a weird issue today.

Created a masterpage and placed it in:
http://servername/_catalogs/masterpage/Forms/AllItems.aspx

Which works just fine for publishing sites but team sites didn't play ball.

I've read a few posts which suggested that you have to activate the publishing feature (both on the site collection level and the site level). Which didn't work for me.

Issue:
Team sites didn't pick up the Master page even after setting:
http://servername/_layouts/ChangeSiteMasterPage.aspx
Site Master Page > Specify a master page to be used by this site and all sites that inherit from it
Selecting my custom master page.
Check: Reset all subsites to inherit this site master page setting

Solution:
Set the "System Master Page".

For some reason team sites use the System Master Page. Don't ask me why. And I don't have time to investigate right now. But there's the solution.

PS. Happy New Year!

Thursday, December 8, 2011

Creating a ListDefinition schema.xml from a List Template (SharePoint 2007)

Have a read of this great article:
Create the structure as per the article above.
  • Create a list in SharePoint and customise it.
  • Save it as a List template.
  • Save the list template file from the list gallery to your local machine.
  • Rename the file extension from STP to CAB.
  • Open up the file and extract the manifest.xml
  • Open up the manifest.xml
All you're concerned with in this file are the following nodes:
  • ListTemplate\UserLists\List\Views
  • ListTemplate\UserLists\List\Fields
Using the original schema.xml file as a template you can copy chunks of XML from the manifest.xml into/over relevant sections.
I've also found it useful to remove all the "ContentType" nodes from the schema.xml file. Otherwise when you go to create a new item or edit an item your custom fields won't show up. You can leave the ContentTypes node just clear out it's contents.

I hope this helps you avoid manually typing out some XML and further associated headaches.
As a quick reference the custom list schema.xml file can be found here:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\CustomList\CustList\schema.xml

Sunday, October 30, 2011

SharePoint: CAML get all calendar items from including recurring items

Situation:
I want to get all calendar items from today onwards including any recurring event items.

Problem:
CAML and SharePoint can be a pain.

Solution:
SPQuery query = new SPQuery();
string queryString =
@"
    <Where>
     <DateRangesOverlap>
      <FieldRef Name=""EventDate""/>
      <FieldRef Name=""EndDate""/>
      <FieldRef Name=""RecurrenceID""/>
      <Value IncludeTimeValue=""TRUE"" Type=""DateTime"">
       <Now/>
      </Value>
     </DateRangesOverlap>
    </Where>
    <OrderBy>          
 <FieldRef Name=""EventDate"" Ascending=""TRUE""/>      
    </OrderBy>
";
query.Query = queryString;
query.ExpandRecurrence = true;

Note:
You should add a query.RowLimit so you don't get too many items back. But that's up to you.

Sunday, October 23, 2011

SharePoint Site Template custom Navigation

Ok this should be simple. It should be straight forward. I should have known better.

Scenario: I'm building a SharePoint 2010 web template.
What I want to do: I want to display two links in the top nav (Home & Shared Documents). I want this navigation to be available as soon as the Site collection is created. There's an obvious place in the onet.xml file to place this. But this area is poorly documented. I had to do a bit of trial and error to achieve what I wanted.

This is the solution to my problem but I have spent way too much time to achieve something so simple.

<NavBars>
 <NavBar Name="$Resources:core,nav_Home;" Separator="&amp;nbsp;&amp;nbsp;&amp;nbsp;" Body="&lt;a ID='onettopnavbar#LABEL_ID#' href='#URL#' accesskey='J'&gt;#LABEL#&lt;/a&gt;" ID="1002" />
 <NavBar Name="SharePoint Top Navbar" ID="1002">
  <NavBarLink Name="Shared Documents" Url="Shared%20Documents/">
  </NavBarLink>
 </NavBar>
</NavBars>

"SharePoint Top Navbar" is the top navigation nav bar. If you want to add links to the top navigation you need to add them in this node.

Sunday, October 9, 2011

Restoring a site collection and getting a "different version of Microsoft SharePoint Foundation" error

Scenario:
Restoring a site collection backup between 2 development environments. I'm using the following Powershell command:
Restore-SPSite -Identity http://spdev/sites/ctmh -Path c:\fpbackups\ctmh.bak
Where spdev is the name of my SharePoint Dev server.
ctmh.bak is the backup file.

Symptom:
Restore-SPSite : Your backup is from a different version of Microsoft SharePoint Foundation and cannot be restored to a server running the current version. The backup file should be restored to a server with version '4.1.9.0' or later.

Steps to get it working:
It seemed pretty straight forward although the version '4.1.9.0' seemed a little strange.
First step is to compare both environment's SharePoint version:
  1. SharePoint 2010 Central Administration
  2. Upgrade and Migration
  3. Check product and patch installation status
I looked up the version number on my favourite search provider and got the appropriate updates. Pretty straight forward really.

I forgot to run the "SharePoint 2010 Products Configuration Wizard" initially and the restore didn't work. So if the SharePoint versions are the same between environments it might be worth while running the wizard to check that the patches have been applied.

Friday, April 15, 2011

Hiding a Flash component in a page

I was scratching my head over this one for a while. I tried putting a Flash component in a DIV and then set the Display: none

This usually works. But not for Flash.

Long story short. The solution I found set is to set either height: 0px or width: 0px.

You may also need to set the overflow: hidden

<div style:"height: 0px; overflow: hidden>Flash thingy goes here</div>

Then when I want to display it I set the width/height via client side script.