Tuesday, February 21, 2017

How to hide the App Store on SharePoint 2013 & 2016

After disabling the App Store in SharePoint (so our internal users couldn't download apps from the app store) the App Store icon still appeared on the left navigation; when clicked, and ugly message appeared.

"Sorry, apps are turned off.  If you know who runs the server, tell them to enable apps."

Well, this isn't very useful.  

After a call to Microsoft Support, I was instructed to hide the App Store instead.

Here are the steps to hide the App Store, which includes hiding the following:

  • SharePoint Store
  • Your Requests
  • Manage Licenses
  1. Make a backup of the AddAnApp.aspx file located in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\TEMPLATE\LAYOUTS
  2. Add the following to the AddAnApp.asxp file on ALL SHAREPOINT SERVERS IN THE FARM
    Search for

    ContentPlaceHolderId=
    "PlaceHolderAdditionalPageHead" runat="server">

    Then copy the following below and paste it under the previous line :

    <script
    language="javascript" type="text/javascript">
                
        window.addEventListener('load'function(){
                            
            function getAll(selector){
                                        
            return Array.prototype.slice.apply(document.querySelectorAll(selector));
                           
            }            
                           
            getAll('.ms-storefront-divider').forEach(function(divider){
                                        
                divider.style.display = 'none';
                            
            });                
                           
            getAll('a').forEach(function(link){
                                        
                if (link.innerHTML == 'Manage Licenses' || link.innerHTML == 'Your Requests' ||
                link.innerHTML == 'SharePoint Store' ) {
                                                   
                    link.style.display = 'none';
                                     
    }
                            
    });
                
    });
    </script>


  3. NOTE: If new servers are added to the farm, the AddAnApp.aspx file will need to be replaced with these changes
    NOTE: To show the SharePoint Store, Manage Licenses, and Your Requests, remove the code
  4. URL Hacking into the hidden areas: Since the hide is just textual, you can still get to the links by hitting the URL
    1. SharePoint Store: .... _layouts/15/storefront.aspx
    2. Your Requests: append to the addanapp.aspx url #mcg=4
    3. Manage Licenses: append to the addanapp.aspx url #mcg=3
  5. Disable "App State Update" Timer Job Go to Central Admin > Monitoring > Timer Jobs > Review Job Definitions and filter by Failed Jobs, you should see a failed Job for "App State Update". click on the job, then disable it.


Happy SharePointing :)
~ Kristin 

Thursday, December 18, 2014

How to limit a SharePoint list to one row, with no-code

How to limit a SharePoint list to one row, with no-code

Have you ever wanted to use the functionality of a SharePoint list, but limit the list to only one row?

Did you go into Item Limit in the view, only to realize that you are limiting the number of items to be viewable, not actually limiting the number of items in the list?

I have, and I have come up with a very simple, OOB, no-code solution: Add a column, that is Required, Enforces Unique Values, and give it a Default Value. That’s it!
However, to make it more robust and transparent, you will need to:

    1. Create a site column


    2. Create a List Content Type


    3. Add the Site Colum to the Content Type


    4. Make the column Hidden
Let’s test it out. After adding my content type to a new custom list, I created one record: “Item 23665.” I can see it in the list. Now, I will attempt to add a second list item: “Item 27788”:


After pressing Save nothing happens (the window stays open – you will have to write some code to force it to close). The user must press Cancel to get out of this modal, and the record will not be saved.

I hope you find this helpful.

- Kristin Cameron


SharePoint Designer Cannot Display the Item

SharePoint Designer Cannot Display the Item

In Office 365, after successfully accessing the SharePoint site via the URL in the browser, and after successfully opening the site in SharePoint Designer 2010 or SharePoint 2013, I continuously received the following error when accessing workflows (to view or edit).


There is a very simple solution to this problem:

    1. Close SharePoint Designer 2013
    2. On the local computer, browse to the following folder:
    C:\Users\\AppData\Local\Microsoft\WebsiteCache
    3. Delete all the folders that are present.
    4. On the local computer, browse to the following folder:
    C:\Users\\AppData\Roaming\Microsoft\SharePoint Designer\ProxyAssemblyCache
    5. Delete all the folders that are present.
    6. Open SharePoint Designer 2013 and make the changes to your site as needed.


The TechNet article can be found here.
- Kristin Cameron

Tuesday, October 8, 2013

SharePoint Saturday Michigan - Managed Navigation

Thanks for everyone who attended my session last Saturday.  Below is a link to the deck.

https://skydrive.live.com/redir?page=view&resid=4A75F44C18CFBFF5!3187&authkey=!AEHUI_-dZn3a2Ck

Feel free to post questions, and I will do my best to respond in a timely manner.

Enjoy the fall colors.

~ Kristin Cameron


Thursday, January 31, 2013

SharePoint 2013 Hardware & Software Requirments

Rather than digging through and compiling Microsoft documentation, here are the hardware & software requirements for SharePoint 2013, all in one place.  

Enjoy! ~ Kristin Cameron










How to put an icon into a SharePoint calendar view


How to put an icon into a SharePoint calendar view



Working on a customized calendar project, the client requested the following:
v     If an executive will be attending an event, put an icon, such as a star, to the left of the event title, in Calendar view.

It sounds straightforward, but in SharePoint, there are often limitations to work around.  In this case, there were two limitations.  One being, that there really are no “icons” in SharePoint 2010.  Two being you can only have one field showing in the month view.  My original thought was to place the icon next to the Title field, but with only one field choice allowed, that wouldn't work.

What you can do; however, is insert ASCII into a text or calculated field.  There are a limited number of ASCII codes for images, but there are plenty of arrows, stars, crosses, etc. to choose from.  So, what I did was created a new calculated field, that was a concatenation of a star, pasted from an ASCII star (if the conditions were met) and the Title field.
The result looked like this:



You can have a lot of fun with this.

Enjoy!
Kristin Cameron, Managing Consultant
Project Leadership Associates

Monday, September 17, 2012


How to Color Code a SharePoint Calendar



There is no OOB way to Color Code a SharePoint calendar.  Bamboo has a web part for purchase; however, this web part has limited functionality and it makes significant changes to the look & feel of the calendar.
In order to simply change the color of the calendar entries, based on a column value, modify the JavaScript at the end of this blog to meet your needs.
1.  Create a document library for your code, such as, https://my.sharpoint.com/sites/MySite/CodeLib/ and copy jquery-1.5.1.js there
2.  Modify the first line of code to point to the location of your document library:  <script type="text/javascript" src="https://my.sharpoint.com/sites/MySite/CodeLib/jquery-1.5.1.js"></script>
3.  Create a column in the Calendar list, called “MyCategory.” 
4.  Modify the switch/case section of the javascript to the categories in your list, and choose the colors you would like:

var colour = null;
        switch (category.trim().toLowerCase()) {
             case 'custom category 1':
                colour = "#7bd148";
                break;
            case 'custom category 2':
                colour = "#f691b2";
                break;
            case 'custom category 3':
                colour = "#fbe983";
                break;
            case 'custom category 4':
                colour = "#9a9cff";
                break;
        }
        return colour;
5.   Save the .js file in a document library within the site collection (make sure all users have READ access to this document)
6.   Create a hidden web part that references this .js file
7.   Create a calculated field with ="|||"&MyCategory&"|||"&Title
8.   Create a calendar view choose the new Calculated field (from step 5) for Month View Title, Week View Title, etc. (instead of the default “Title”)


JavaScript
<script type="text/javascript" src="https://my.sharpoint.com/sites/MySite/CodeLib/jquery-1.5.1.js"></script>
<script type="text/javascript">
    _spBodyOnLoadFunctionNames.push('WaitForCalendarToLoad');
    var SEPARATOR = "|||";
    function WaitForCalendarToLoad() {
        if (typeof SP.UI.ApplicationPages.CalendarNotify.$4a == 'undefined') {
            // post SP1
            var pwold$4b = SP.UI.ApplicationPages.CalendarNotify.$4b;
            SP.UI.ApplicationPages.CalendarNotify.$4b = function() {
                pwold$4b();
                ColourCalendar();
            }
            SP.UI.ApplicationPages.SummaryCalendarView.prototype.renderGrids = function($p0) {
                var $v_0 = new Sys.StringBuilder();
                var $v_1 = $p0.length;
                for (var $v_2 = 0; $v_2 < $v_1; $v_2++) {
                    this.$7t_2($v_2, $p0[$v_2]);
                }
                for (var $v_3 = 0; $v_3 < $v_1; $v_3++) {
                    $v_0.append('<div>');
                    this.$I_2.$7o($v_0, $p0[$v_3], $v_3);
                    $v_0.append(this.emptY_DIV);
                    $v_0.append('</div>');
                }
                this.setInnerHtml($v_0.toString());
                ColourCalendar();
            }
        }
        else {
            // pre SP1
            var pwold$4a = SP.UI.ApplicationPages.CalendarNotify.$4a;
            SP.UI.ApplicationPages.CalendarNotify.$4a = function() {
                pwold$4a();
                ColourCalendar();
            }
            SP.UI.ApplicationPages.SummaryCalendarView.prototype.renderGrids = function($p0) {
                var $v_0 = new Sys.StringBuilder();
                var $v_1 = $p0.length;
                for (var $v_2 = 0; $v_2 < $v_1; $v_2++) {
                    this.$7r_2($v_2, $p0[$v_2]);
                }
                for (var $v_3 = 0; $v_3 < $v_1; $v_3++) {
                    $v_0.append('<div>');
                    this.$I_2.$7m($v_0, $p0[$v_3], $v_3);
                    $v_0.append(this.emptY_DIV);
                    $v_0.append('</div>');
                }
                this.setInnerHtml($v_0.toString());
                ColourCalendar();
            }
        }
    }

    function ColourCalendar() {
        if (jQuery('a:contains(' + SEPARATOR + ')') != null) {
            jQuery('a:contains(' + SEPARATOR + ')').each(function(i) {
                $box = jQuery(this).parents('div[title]');
                var colour = GetColourCodeFromCategory(GetCategory(this.innerHTML));
                //this.innerHTML = GetActualText(this.innerHTML);
                this.innerHTML = "<span style='color:#000000'>" + GetActualText(this.innerHTML) + "";
                jQuery($box).attr("title", GetActualText(jQuery($box).attr("title")));
                $box.css('background-color', colour);
            });
        }
    }

    function GetActualText(originalText) {
        var parts = originalText.split(SEPARATOR);
        return parts[0] + parts[2];
    }

    function GetCategory(originalText) {
        var parts = originalText.split(SEPARATOR);
        return parts[1];
    }

    function GetColourCodeFromCategory(category) {
      
var colour = null;
        switch (category.trim().toLowerCase()) {
            case 'custom category 1':
                colour = "#7bd148";
                break;
            case 'custom category 2':
                colour = "#f691b2";
                break;
            case 'custom category 3':
                colour = "#fbe983";
                break;
            case 'custom category 4':
                colour = "#9a9cff";
                break;
        }
        return colour;
    }
</script>



Happy Color Coding!

-          Kristin Cameron, Managing Consultant
   Project Leadership Associates