Cascade Skyline - with Microsoft Logo and Project Support header - author Brian Smith

  • Brian Smith's Microsoft Project Support Blog

    Project and SharePoint: How does Project know where its tasks are?

    • 1 Comments

    Not really a support thing as such – but I had a question a while ago about the feature to save projects to task lists, and how they are kept in sync?  And how can I get at the right task in the SharePoint list programmatically – as the IDs don’t seem to match?  Nothing to do with the Project Server 2013 sync of tasks from the plan to the site task list – this is the feature that works from the Microsoft Project client to any SharePoint site – no need for Project Server.  I didn’t know the answer, but I was keen to find out as I too had seen IDs showing in the SharePoint task list that didn’t appear to match the plan – yet they were still kept in sync.  Of course I could have just gone and read the spec…  But where is the fun in that?

    I’m starting off with a simple plan:

    image

    And saving to a new site – BlogPost, where the tasks will be added to the “Tasks” List, which happens to be on my Project Online tenant – but could be just a SharePoint on-premises or Online site.

    image

    Here is my view in the new list on my new site – and I have added the ID column to my view, and also turned on versioning (which will help later to see what’s happening)

     

    image

    If I swap my tasks around in Project and save again – my task list gets updated too – all my IDs look as expected, with a useful message along the way so I can see what has happened:

    image

    image

    image

    Unique ID still equals ID – looking good!  Now I’ll add a new task in my plan, and a new task in my list – then sync – and see what happens

    image

    image

    Hmm – 2 tasks with ID of 4.  What will save/sync in Project make of this?

    image

    In project I get a new ID of 5 for the task that had ID of 4 in the list.

    image

    But in SharePoint it also adds the task from Project and makes it ID 5 – and keeps its own task as 4.

    What happens if I edit the ‘Project’ task 4 – by updating the task name for example?

    image

    image

    So even though the ID in SharePoint no longer matches the one in Project – it did the right thing.  How does it know?

    This is where I take a look at versioning and other list settings, as it shows a few things that explain how this all works.  From the List tab on the SharePoint task list we can go to List Settings, and if we scroll down we can also see the columns for this list.

    image

    The ones that jumped out at me were the highlighted ones, SyncedProjectGUID and TaskUID – but I didn’t see them in the list of columns that I could add to a view.  I did however see them in the history when I looked at Version History for the Task that was added in SharePoint.

    image

    I can see that the TaskUID is 5 – which matches the UniqueI D in the project plan!  So that explains how Project keeps track of the tasks – but how does it keep track of the project?  I knew it must have some way to track this, as I had seen warning messages if you try to sync a different project to a site.  I can see the SyncedProjectGUID here is B34FEFA5-34AE-E411-827D-00155D745A06 – but what exactly does that mean?  It didn’t seem to match up to any other identifier I could see for the list – although I did manage to find it in the client side logging and also in a Fiddler trace.  In case you are not familiar with it – Fiddler can sit between your browser/application and the web server and show what traffic is going back and forth (including passwords – so don’t share Fiddler traces without adequate security – and preferably never start a trace until after you have logged in!).  This is just part of the payload of a call to lists.asmx:

    <Field Type="Text" Name="SyncedProjectGUID" DisplayName="SyncedProjectGUID" Description="GUID of the Synced Project.  Please don&#39;t modify or delete." AllowDeletion="FALSE" ShowInDisplayForm="FALSE" ShowInEditForm="FALSE" ShowInNewForm="FALSE" ShowInViewForms="FALSE" ID="{7966fcc7-e870-4d22-8c5f-3e39710f743d}" Version="4" StaticName="SyncedProjectGUID" SourceID="{bfcb303b-79e2-46d3-9c4f-7e42592c9b66}" ColName="nvarchar5" RowOrdinal="0"><Default>{B34FEFA5-34AE-E411-827D-00155D745A06}</Default></Field>

    Now those properties of the list item helped me understand why I wasn’t able to show this as a column on the task list.  From the client side logs (and perhaps that should be a good topic for another day) I saw the log entry pertaining to this Fiddler traffic:

    02/06/2015 14:07:11.24    WINPROJ.EXE (0x14ac)    0xe28    Project Client    Wss    ahmpf    Verbose    Entering Function=CWssList::UpdateList   pwzNewFields = (null) pszUpdateFields = <Fields><Method ID="1"><Field Type="Text" Name="SyncedProjectGUID" DisplayName="SyncedProjectGUID" Description="GUID of the Synced Project.  Please don't modify or delete." AllowDeletion="FALSE" ShowInDisplayForm="FALSE" ShowInEditForm="FALSE" ShowInNewForm="FALSE" ShowInViewForms="FALSE"> <Default>{B34FEFA5-34AE-E411-827D-00155D745A06}</Default></Field></Method></Fields> pszDeleteFields = (null) pszProperties = (null)    7C768CFF-AE4C-11E4-827D-00155D745A06

    I’m imagining some of you are looking at that and thinking this looks like a ULS log – and the format is the same – which means you can read the client side logs in ULSViewer. 

    Part of the original question was how do I get at the task in the list programmatically – if I know the TaskUID/Unique ID from the project plan?  I had a play around with OData calls to the list and found that it is easy to go to the ID of the item from the SharePoint list – just using the indexer – so for ID 4 in the list I can get to it with:

    https://brismithteched2014.sharepoint.com/BlogPost/_api/web/lists/getbytitle('Tasks')/Items(4)

    But as the TaskUID is returned as a property when I viewed the output from that Url I knew that I should just be able to use a Filter on that property – and the following Url returned exactly the same item.  Problem solved – partly.

    https://brismithteched2014.sharepoint.com/BlogPost/_api/web/lists/getbytitle('Tasks')/Items?$filter=TaskUID%20eq%205

    However, that still didn’t help me understand where this GUID was stored from the project end – it isn’t showing as a property anywhere that I could see.  I then went to another trusty tool – DocFile Viewer - DFView.exe, which used to ship with Visual Studio, and allows you to see inside of various file that use OLE Doc format.  I saved a copy of the mpp (called BlogPost-Tasks.mpp – the standard format of name that a task sync project gets saved as) from the Site Assets folder on my BlogPosts site using the “Download a copy” option (under the ellipses, under the ellipses) – then opened with DFView.

    image

    This shows the various data structures – and the one I looked in first (and got lucky) was the Props under 114.

    image

    There I scrolled down a bit and could see my projguid B34FEFA5-34AE-E411-827D-00155D745A06, as well as the list Url and other information such as the sync time.  Very cool – well to me anyway.  Not particularly useful – and not exposed as far as I can see – even to VBA – but it was good to finally understand how project and the task list kept tags on each other!

    If you are interested in client side logging and can’t wait for me to blog it – then the session Adrian and I did at the Project Conference covers the configuration of 2013 Client logging - http://channel9.msdn.com/Events/Project/2014/PC209 - around about 37 minutes Adrian starts the Client Logging part, and moves on to 2013 logging at around 55 minutes.  Worth watching to get an idea how the logging works.  The slides that you can download from the same link contain the registry settings for 2010 and 2013.

  • Brian Smith's Microsoft Project Support Blog

    Project Server January 2015 Round-up

    • 2 Comments

    A short round-up of the world of Project Server 2013 and Project Online as we reach the end of the first month of 2015.  I added an update to my “opening plans from a SharePoint Document Library” post -  as I’d managed to repro issues with read-only even when using a domain account opening a domain account authenticated library.  We have a fix request in to the product group for this – still in initial triage currently.

    Elsewhere in Project Land we have had some very interesting articles.

    From other Project bloggers this month:

    And a shameless plug for the Seahawks! Hopefully celebrations will continue this weekend in Seattle

    111231_Mg_005 

  • Brian Smith's Microsoft Project Support Blog

    Project and Project Server Cumulative Update Archives Complete

    • 3 Comments

    Just added the final piece to the full lists of fixes for each of Project and Project Server 2013, and Project and Project Server 2010 (and no – I am NOT going to be adding 2007 versions…) – over on the Project Support blog:

    image

    Clicking the links will take you to a single page for each product that lists all the cumulative updates and service packs, including the fixed items and version numbers.  I aim to update these as each new update comes out – so just in time to be ready to add the next set on February 10th (or soon after).

    Enjoy!

  • Brian Smith's Microsoft Project Support Blog

    Project and Save to SharePoint and other recent blog posts

    • 1 Comments

    I posted a blog over on Project Support covering some issues when opening mpp files from SharePoint, and also highlighting some of the differences Project has from its Office cousins – Word, Excel, PowerPoint and Visio – and will follow up with further information on version support and the Sync to SharePoint options.  First post is here http://blogs.technet.com/b/projectsupport/archive/2015/01/06/saving-projects-to-sharepoint-and-opening-them-again-part-1.aspx and I did make some edits this morning to aid readability – added some headers and captions to the screenshots.  The main points remain the same however.

    While I am posting there are also some good new posts from the MVP community (and others) that I thought were worth a shout out:

    I usually only search through the MVP posts but Erik van Hurck has posting some good stuff at The Project Corner including a very useful Resources page.  And I’m ot just saying that because this site is on the list!  I’ll keep an eye out for other good project blogs – some of the regulars have been a little quiet lately!

    Finally in case you haven’t seen them we do have some support content from my European colleagues:

    Hope you enjoy all this great content!  And Happy New Year 2015!

     

  • Brian Smith's Microsoft Project Support Blog

    Project Online: Create Projects does not like trailing spaces

    • 0 Comments

    Always fun to find the root cause and a good way to unblock a customer, even if as in this case the customer was '”one of our own” in CSS using one of our (many) internal Project Online instances.  The problem here was with a feature that I am sure some of you may not have come across, which enables you to create a project from a list item in a custom list (not a Task list – just a basic custom list).  The idea here is that you have a list of potential projects in your custom list, and when you decide the time is right to make it a real project you just select it (or them) from the list and click in the Items Tab, and Create Projects! 

    image

    Easy – except when it isn’t.  You may get the dreaded “Sorry, something went wrong” error, and a correlation ID – but as you can’t get at the logs there isn’t much to help you.  I do have access to the logs (as you would if you hit this on-premises – more later…) and I was suspicious of some white space between a project name and a full stop – plus of course the error “ProjectInvalidName”.

    12/29/2014 11:08:29.54    <servername>:w3wp.exe (0x42A8)    0x4CFC    Project Server    General    8yi1    Medium    Error is: ProjectNameInvalid. Details: Attributes:  PlusSpaces     . Standard Information: PSI Entry Point:…..

    The next problem is that if you just try again (either after removing the spaces, or just hoping it might work) then you get:

    A project already exists for list item with title PlusSpaces . Please select a list item that is not already converted to a project.

    image

    What’s going on?  I had a dig around and from a previous question from one of our MVPs I had discovered that we add a field to the list item that we track to understand that a project was created – a GUID - MSPWAPROJUID.  I’d played around with this on-premises, but hadn’t needed to do this kind of thing in Project Online.  A quick search got me to a good sample of a PowerShell script from Craig Riter on StackOverflow – then just needed to home in on the properties I was interested in and reset then to empty.  I suspect other project creation failures may also leave the list item already tagged to a project, and my first work-around was just to copy and paste to a new list item – but cleaning with with PowerShell feels like a better solution.  In my on-premises environment I repro the failure to create the project – but I just needed to delete the spaces and it would then work fine.  It looks like we have changed the GUID stamping in one or the other environments.

    Here is my PowerShell in case you find yourself having a similar issue – and thanks again to Craig,

    #Load necessary module to connect to SPOService
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client") | Out-Null
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime") | Out-Null

    #Login Information for script
    $User = "me@<sitename.onmicrosoft.com"
    $Pass = “MyPassword”

    $WebUrl = .sharepoint.com/sites/PWA">https://<sitename>.sharepoint.com/sites/PWA

    #Connect to SharePoint Online service
    Write-Host "Logging into SharePoint online service." -ForegroundColor Green

    $Context = New-Object Microsoft.SharePoint.Client.ClientContext($WebUrl)
    $Context.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User, (ConvertTo-SecureString $Pass -AsPlainText -Force))

    #Get the right list
    Write-Host "Getting the required list." -ForegroundColor Green
    $List = $Context.Web.Lists.GetByTitle("Project Intake")

    $Query = [Microsoft.SharePoint.Client.CamlQuery]::CreateAllItemsQuery(100);
    $Items = $List.GetItems($Query);

    $Context.Load($Items);
    $Context.ExecuteQuery();

    #Edit existing list items
    foreach($item in $Items){
        $item["Title"]
        $item["MSPWAPROJUID"]
            If ($item["Title"].Trim() -eq "PlusSpaces")
            {
             $item["MSPWAPROJUID"] = ""
            $item["MSPWAPROJPUBJOBID"] = ""
            Write-Host "Removing PWA GUIDS for Id=$($item.Id)." -ForegroundColor Green
            }
            $item.Update()
             $Context.ExecuteQuery();
                  
    }

    Write-Host "Your changes have now been made." -ForegroundColor Green


    In this example I was just looking for my “PlusSpaces   “ project – and used the trim as the first time my “If” didn’t hit as I got the number of spaces wrong.  Duh…  I executed this from my on-premises environment and the SharePoint Management Shell so probably had all the right DLLs handy – if you are using just your normal PC and PowerShell you may need to load other stuff – but I’m sure there are blogs out there to point you in the right direction.

    This sets me thinking that there is also an answer to the funny stuff that can happen with the hidden user information list and Project Online.  Anyone for a name change? 

     

     

Page 3 of 97 (483 items) 12345»