in

Dot Net Mafia

Group site for developer blogs dealing with (usually) .NET, SharePoint, Office 365, Mobile Development, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog

Syndication

Archives

Corey Roth [MVP]

A SharePoint MVP bringing you the latest time saving tips for SharePoint 2013, Office 365 / SharePoint Online and Visual Studio 2013.

June 2013 - Posts

  • Surface RT: Even more awesome with Windows RT 8.1

    For those that know me, I am a die hard supporter of my Surface RT.  Back in February, I wrote a post about why I chose it over a Surface Pro.  The device wasn’t perfect and there were a number of issues that people had with it.  With Window RT 8.1, a lot of those issues have been put to rest and that’s pretty exciting. 

    This device isn’t for everyone, but if you have a similar use case to mine, you might find it a highly useful device.  What is my use case?  Well, first of all, I travel. A lot.  I often find myself working from atypical office settings including the airport, airplanes, restaurants, and bars.  As a SharePoint architect, I write very little code. That means having Visual Studio on the device is not a priority for me.  If you write code every day, go buy a Surface Pro, or better yet stick with a laptop so you can have a bigger screen.  Do I use my Surface RT as my primary machine?  Only when I travel so that probably means a good 50% of the time.  Do I play games on it?  Nothing serious.   If any of the above applies to you, read on and you might find that this could be the device for you.

    When I am not working, I often find myself catching up on things with my Surface RT while listening to music on my Jambox.  I use apps such as iHeartRadio, Vevo, and Nokia Music pretty often.  With this much use, it’s not uncommon that I might use my Surface 8 – 10 hours in a day.  Your Surface Pro isn’t going to do that.

    Let’s take a look at a few of my new favorite things that make Surface RT even better.

    SkyDrive Sync

    As someone on the go.  I rely on SkyDrive heavily.  I expect my documents to be available wherever I go regardless of connectivity.  Windows RT could access files in SkyDrive but only when connected.  This was a real bummer when I got on a plane without Wi-Fi.  Although more and more @SouthwestAir flights are connected, there are still a lot that aren’t.  This meant if I wanted to work on a document on the plane, I had to open it up before hand to be sure I had a copy of it.

    Now, the same functionality that we had in the SkyDrive desktop app is built into the Windows RT 8.1 app. 

    WindowsRT81SkyDriveDesktop

    The default setting on whether files are synced or not varies depending on your past usage of SkyDrive.  This can be controlled on a per file / folder level.  You can sync your entire SkyDrive by using the settings charm and choosing Access all files offline.  SkyDrive will indicate whether the file is available offline right in the app.

    Screenshot (4)

    Unfortunately, you can’t configure where the files themselves are synced.  If that bugs you, reply to this thread and raise your concern.  However, this isn’t a huge issue for me yet.  I am definitely happy that I can access my files when I am offline.

    Outlook RT

    When Surface RT came out, people raised a big stink about how Outlook wasn’t included.  Ironic, since the iPad they were using previously ran Outlook so well…oh wait.  Anyhow, Outlook RT will shut a lot of people up.  I mean a lot.  Honestly, I haven’t even used it yet though.  I configured it, but since the February update to the mail app, it’s quite a bit more responsive and I can do most of what I need with the exception of managing tasks.  For that, I will have to return to Outlook.

    They also demoed a new and updated Mail app at Build but that is not included.  That is “coming soon”.

    Skype

    I haven’t had anyone call me yet, but they added the ability to answer Skype calls from the lock screen.  That is nice.  I’m not sure if this functionality is included yet, or it is “coming soon”, but this will be a nice feature.

    UPDATE: After a few days of using it, I have noticed some issues with my connection dropping and the app just crashing in the middle of the call. 

    Apps

    The app story is getting better.  Facebook is finally coming to the Windows store.  Does anyone on Surface care?  Probably not because they have been using it in their web browser just as they would on their laptop.  Remember, the reason web sites started making apps to begin with was because the browser experience sucked on that device.  I truly believe the days of native apps as just as interface to a web site are coming to an end.

    Does the Windows Store have a ways to go?  Yes, but when I go back to my original use case above, I now find that I am only missing three apps that I use on a regular basis: Windows Live Writer, Visio, and Project.  I am not holding my breathe on Live Writer because each time it gets an update, I am shocked.  Honestly, I don’t use the last two all that much, but it would be nice. 

    One thing you’ll notice is that you’ll see your apps automatically synchronize across your Windows 8.1 devices.  When you hit the start screen the first time, you’ll notice an arrow icon next to your apps.  This means it hasn’t been downloaded yet.  You can tap it to start the download or if you wait patiently, eventually Windows will go and grab it.  As you might have heard, apps update automatically as well.  I guess Apple will claim they invented that first though since they added that to IOS 7.

    VPN

    Supposedly the VPN experience is getting better and I really hope so.  As business users, we have put up with crappy VPN clients for years.  In my experience, most clients are buggy being written using ActiveX or Java, are rarely updated, and don’t deal well with new browsers or operating systems.  If Windows can start operating native support for these, sign me up.  This was a major blocker for a lot of Surface RT users wanting to access corporate resources.  Windows RT 8.1 brings hope for native VPN connections to F5, SonicWall, and CheckPoint.  I tried it with our SonicWall VPN and it gave me an error.  However, it’s not like I ever got the regular VPN client to work anyways.  I really don’t expect these to work until RTM and chances are they will require an update to the VPN appliance, that your IT team will never get around to applying.  If you are a VPN administrator, I am sorry, but you know your users don’t like these. :)

    Screenshot (5)

    New Tile Sizes

    This isn’t really specific to RT, but I do like the new tile sizes just as I like them on Windows Phone 8. It gives you a lot of flexibility on how you maximize your screen real estate.  If the tile doesn’t actually update, there is no need for it to be huge.

    Screenshot (3)

    I am kind of liking the new super tiles too.  I can see those being useful for certain scenarios.  You’ll also notice I have four rows of tiles.  You can get this by swiping in from the right to go the Settings charm –> Tiles –> Show more tiles.  Special thanks to Jennifer Stevenson (@jlstvnsn) for pointing this out.

    Screenshot (11)

    Xbox Music

    I gave the previous Music app several tries.  All it did is success in frustrating me.  It was just so slow an unresponsive.  I haven’t used the new app a ton yet, but it already looks a lot better and feels faster.  I think this might be an interface I can work with.  As Scott Hanselman pointed out, you can even include your SD card in your music library without a bunch of hacks.

    Screenshot (7)

    This is some of the pre-loaded music included.  As we speak, it’s currently adding my library off the SD card so I didn’t have more songs to show.

    Quiet Hours

    Scott also pointed this out in his post.  I work with a team in Dubai and this is huge for me.  They come online 9 hours before I do.  That means, when I am going to sleep, they are sending me E-mails.  Sometimes, I forget to lower the sound volume and I have been woken up more than once because of it.  Now, if only I could get this functionality on my phone.

    Alarms

    At one point it occurred to me after I bought my Surface RT, that there was no alarm feature.  I am glad that they have taken the time to add this functionality.  I haven’t tested it yet, but my assumption is that it should wake me up even when my device is running in connected standby mode.  Will it work with a Surface Pro in regular standby mode?  I’m curious to know the answer.  Someone try it out and let me know.  I’ll also be trying the alarm functionality tomorrow morning to see if I can rely on it some day to get me up to go to an airport.

    Screenshot (10)

    UPDATE: I tried this out this morning and it successfully woke me up.  Some of the chimes could be more alarm sounding but it does the job.

    What’s broken?

    As with any beta software, we expect issues.  The device is stable.  The main thing that is not working for me right now is the Pictures app.  It simply doesn’t show anything from Skydrive, Facebook, etc.  It also crashes quite often too.  I’m sure we won’t have to wait for another build though.  Since it’s an app, we’ll probably see an update before long at all.

    UPDATE: according to this forum post, this is by design.  This has quite a few in the community fuming.  I am hoping they reconsider.

    Conclusion

    I’ve been particularly excited about this update for my @Surface RT.  It makes it an even better device.  What do you think?  For those considering a Surface Pro were any of these items a blocker before? 

  • How to: Get list item attachments using REST and JavaScript in SharePoint 2013

    If you’re like me, you like complete code samples.  I don’t like having to infer the code I am supposed to right when I see a reference in the API.  I don’t program much any more, so I admit I am lazy and want to see a complete example that I know works.  Yesterday, I wanted to get the URL of a list item attachment so I could bind it to an img tag.  The Basic Operations with SharePoint 2013 REST endpoints post does a pretty good job explaining a lot of scenarios.  What it is lacking though is a complete end-to-end JavaScript example.  That’s why I am here today to share what I came up with.

    This assumes, that you already have an id of a list item that you picked up somewhere along the way.  Most likely from some other REST API call.  You can put this code in an App Part or anywhere else you can make a REST call.  The first part of dealing with anything with REST is constructing the URL.  Again, the Basic Operations post does a great job explaining this.  This all depends on where your lists is host web or app web.  Let’s make an assumption that I have a list on my app web and I assign the URL to a variable spAppWebUrl it like in my previous REST post.  Let’s build the rest of the URL.  We use getByTitle with the list name.  We then use items with an index of the list item id I mentioned earlier.  Finally we need to add /AttachmentFiles to the end of the URL to get attachments. 

    var queryUrl = spHostUrl + "/_api/web/lists/getbytitle('MyListTitle')/items(" + id + ")/AttachmentFiles";

    Here’s what it looks like together.  You can paste this into a web browser window to verify it works.

    Now, we need to $.ajax to make the REST call and then we’ll process the results.  We’ll pass in methods to handle the success and error conditions.

    $.ajax({

        url: queryUrl,

        accepts: {

            json: "application/json;odata=verbose"

        },

        method: "GET",

        success: onQuerySuccess,

        error: onQueryError

    });

    In our onQuerySuccess method, we’ll iterate through the attachments and do whatever operations we need such as binding them.  This will return all attachments and then we can bind it in whatever manner you like.

    function onQuerySuccess(data) {

        if (data) {

            $.each(data.d.results, function () {

                // do something

                this.ServerRelativeUrl;

            });

        }

    }

    In the above example, I check to ensure the data object came back.  I then loop through on data.d.results.  That object will have a property ServerRelativeUrl which has a relative URL that you can use.  This is great for providing a link to the document or to bind to something like an img tag.

    The last thing to implement is the code to handle errors.  It’s relatively simple and just writeserror.StatusText to the div.

    function onQueryError(error) {

        $("#resultsDiv").append(error.statusText)

    }

    As you can see, getting list item attachments is pretty easy using REST.  Give it a try.

  • Increasing the maximum number of characters indexed by search in SharePoint 2013

    One less publicized change in the April 2013 CU for SharePoint 2013 is the ability to change the maximum number of characters indexed of a given file.  By default, SharePoint indexes 512 KB of the body of a document.  Anything after that isn’t include as it doesn’t deem it relevant.  This can be changed now with a simple PowerShell script.  Before, we do this, you should know that this default value is mentioned in the Software Boundaries and Limits document.  A page that anyone that administers SharePoint should be quite familiar with.  This basically states, the more you index, the more disk space you consume and the more load you place on your system.  Therefore, I encourage you to test this out thoroughly before turning on your production farm of multiple TB of content.  Assuming, you have tested everything and you are good to go, let me show you what you need to do.

    Create a simple script file and add the following commands.  This first command gets a reference to the body managed property.  You need to specify the name of your Search Service Application which most people tend to name Search Service Application.

    $mp = Get-SPEnterpriseSearchMetadataManagedProperty -Identity body -SearchApplication "Search Service Application"

    On the next line you specify the number of characters to index in bytes.  By default, that means this value is 524288.  In my example, we’ll increase it to 1 MB, so we’ll use a value of 1048576

    $mp.MaxCharactersInPropertyStoreIndex = "1048576"

    Now, the next line commits the changes to the managed property.

    $mp | Set-SPEnterpriseSearchMetadataManagedProperty

    Finally, you can see the value you set with, the last command.

    $mp.MaxCharactersInPropertyStoreIndex

    Once you run this script, you should simply see the value you set at the command line.

    SearchPowerShellMaxIndexedCharacters

    If you get an error such as the following, that means you do not have the April 2013 CU or later.  You’ll need to apply this CU if you want this functionality.  Be aware, it can take a long time to apply this CU.

    Exception setting "MaxCharactersInPropertyStoreIndex": "The managed property "body" can't have MaxCharactersInPropertyStoreIndex set to 1048576: The value must be in the range from 0 to 450."

    If you didn’t get any errors, you now need to perform a full crawl as expected.  You should then have more content in your index.  This can be tricky to test because you’ll have to go into files and find content that wasn’t previously in the index, but now it is.  Good luck!

2015 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems