Microsoft Project Support Blog

The place to come for Microsoft Project, Microsoft Project Server and Project Online support topics

Project Server 2013: Error loading views if the default view is missing

Project Server 2013: Error loading views if the default view is missing

  • Comments 12
  • Likes

My colleagues in Europe have already blogged about this topic, Marc on the French blog - http://blogs.technet.com/b/frenchpjblog/archive/2013/12/06/3616538.aspx and Jorge on the Portuguese Spanish (sorry Jorge...) - http://blogs.technet.com/b/elfarodeprojectserver/archive/2013/12/09/project-server-2013-error-al-cargar-las-vistas-despues-de-eliminar-las-vistas-originales-predeterminadas-the-view-failed-to-load.aspx – thanks Guys!  And here is an English version too.

Typically this can happen after a 2010 to 2013 upgrade – but there are other scenarios – even with Project Online (more later) – and really any time the default view that is expected is missing then this ‘View Failed to Load” message can be seen.

For the migration scenario this happens if the default views were deleted in 2010 before migration to Project Server 2013.  The database table [pub].MSP_WEB_USERPROPERTIES holds information relating to personal views – such as the last loaded view for particular pages, and other changes you may have made to views (slider position for split views etc.).  In a fresh migration this table is empty – and when a user navigates to a page (Project Center or Resource Center) then the default view is being populated to the table.  However, in this case the default view no longer exists – hence it fails to load and looks like this:

Clicking OK will then give a misleading error message – You don’t have permissions to view any projects (or resources if you are looking at the Resource Center):

This is being worked on in a future Cumulative Update – and is anticipated to be corrected in the Cumulative Update release in April 2014 for Project Server 2013, but for now the resolution to this one, unfortunately, involves making some changes to the database – something I don’t generally like to get customer to do – but here goes:

IMPORTANT: The following SQL scripts add data to the database so you should first try this on a test environment so you can be sure you are happy with the results.

Step 1: Set the UID of the custom default views for all users in the [pub] table.MSP_WEB_USERPROPERTIES table

/****** Object:  Script to populate User Properties table. Created by Marc Biarnes 07/11/2013 ******/

DECLARE @RESUID UID;
DECLARE @P2 DBO.USERPROPERTIES
INSERT INTO @P2 VALUES(N'JSGridWidthResourceCenterJSGridControl','827',NULL,N'resourcecenterjsgridcontrol')
INSERT INTO @P2 VALUES(N'SelectedResourcesResourceCenterJSGridControl','[]',NULL,N'resourcecenterjsgridcontrol')
INSERT INTO @P2 VALUES(N'SelectedResourceIdsResourceCenterJSGridControl','[]',NULL,N'resourcecenterjsgridcontrol')
INSERT INTO @P2 VALUES(N'ViewUidResourceCenterJSGridControl','<View_UID of the custom view in [pub].MSP_WEB_VIEW_REPORTS>',NULL,N'resourcecenterjsgridcontrol')
INSERT INTO @P2 VALUES(N'ViewUidProjectCenterJSGridControl','<View_UID of the custom view in [pub].MSP_WEB_VIEW_REPORTS>',NULL,N'projectcenterjsgridcontrol')
DECLARE FIXRESVIEW CURSOR FOR SELECT RES_UID FROM PUB.MSP_RESOURCES;
-- OPEN THE CURSOR.
OPEN FIXRESVIEW;
FETCH NEXT FROM FIXRESVIEW INTO @RESUID
-- LOOP THROUGH THE RESOURCES.
WHILE @@FETCH_STATUS = 0
BEGIN;
       EXEC [PUB].MSP_WEB_SP_QRY_SETUSERPROPERTIES @RESID=@RESUID,@PROPERTIES=@P2
       FETCH NEXT FROM FIXRESVIEW INTO @RESUID
    END;
-- CLOSE AND DEALLOCATE THE CURSOR.
CLOSE FIXRESVIEW;
DEALLOCATE FIXRESVIEW;

Step 2: Set the UID of the custom default views for each new user in the [pub] table.MSP_WEB_USERPROPERTIES table

/****** Object:  StoredProcedure [pub].[XMGS_SetDefaultViewByResUID]    Script created by Marc Biarnes 07/11/2013 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [pub].[XMGS_SetDefaultViewByResUID]
(
@RESUID UniqueIdentifier
)
AS
BEGIN
DECLARE @P2 DBO.USERPROPERTIES
INSERT INTO @P2 VALUES(N'JSGridWidthResourceCenterJSGridControl','827',NULL,N'resourcecenterjsgridcontrol')
INSERT INTO @P2 VALUES(N'SelectedResourcesResourceCenterJSGridControl','[]',NULL,N'resourcecenterjsgridcontrol')
INSERT INTO @P2 VALUES(N'SelectedResourceIdsResourceCenterJSGridControl','[]',NULL,N'resourcecenterjsgridcontrol')
INSERT INTO @P2 VALUES(N'ViewUidResourceCenterJSGridControl','"000010FC-7B06-45A9-9BD2-1CBFC2F64CE4"',NULL,N'resourcecenterjsgridcontrol')
INSERT INTO @P2 VALUES(N'ViewUidProjectCenterJSGridControl','<View_UID of the custom view in [pub].MSP_WEB_VIEW_REPORTS>',NULL,N'projectcenterjsgridcontrol')
INSERT INTO @P2 VALUES(N'ViewUidProjectDrillDownJSGridControl','<View_UID of the custom view in [pub].MSP_WEB_VIEW_REPORTS>',NULL,'Nprojectdrilldownjsgridcontrol')
EXEC [PUB].MSP_WEB_SP_QRY_SETUSERPROPERTIES @RESID= @RESUID,@PROPERTIES=@P2
END;

Once this stored procedure has been created then simply run the following command to add the custom default views to the user settings:

EXEC [PUB].XMGS_SetDefaultViewByResUID @RESUID= ‘<RES_UID>’

To get the View_UID you can go to Manage views, then select the view you want as the current default (assuming you have deleted the real default – and the Url will contain the UID – for example:

Summary view showing UID of the view in the Url

I’m sure several of you are now thinking – “So how does this work with Project Online – we can’t touch the databases?”  Also you will not have migrated – so the properties table will not be empty so not so many ways this can get broken.  We have seen issues with timesheets where views get changed giving a similar problem – generally if you can get to any timesheet and change the view then things will be good.  If you can’t or have another scenario where you see this break in Project Online then open a support incident and we will get you sorted.

Comments
  • I am getting this error after 2010 to 2013 migration and tried your script. I am still getting the same error but now i can see the list of available views in View drop down. If i select any view, the view loads but permission error also appears and the view doesn't accept any mouse input.

  • Never mind, i made some mistakes in query. its working now

  • We came up with this error on a new install. There is a workaround. (1) From the first error, select a new view from the view option, (2) from the second error, refresh the page. The page will then work and this view will now be the default going forward. This happens in Project Center and the Scheduling web part (and I guess timesheets but we aren't using timesheets). This workaround will need to be performed once for each user.

  • Hi Brian!
    1) is it only for me interesting why in 1-st step there are 5 inserts but in second there are 6?

    2) are VIEW_UIDS identical in inserest:

    INSERT INTO @P2 VALUES(N'ViewUidResourceCenterJSGridControl','"000010FC-7B06-45A9-9BD2-1CBFC2F64CE4"',NULL,N'resourcecenterjsgridcontrol')
    I think in 1-st we must put any one from (select WVIEW_UID, WVIEW_NAME from [pub].MSP_WEB_VIEW_REPORTS where WVIEW_TYPE = 3) and all users should have the permission on this view

    INSERT INTO @P2 VALUES(N'ViewUidProjectCenterJSGridControl','',NULL,N'projectcenterjsgridcontrol')
    I think in in this insert we must put any one from (select WVIEW_UID, WVIEW_NAME from [pub].MSP_WEB_VIEW_REPORTS where WVIEW_TYPE = 1)

    3) i add this insert to 1-st step. am i right? becouse i have a problem with projects views to....
    INSERT INTO @P2 VALUES(N'ViewUidProjectDrillDownJSGridControl','',NULL,'Nprojectdrilldownjsgridcontrol') ?
    and in in this insert we must put any one from (select WVIEW_UID, WVIEW_NAME from [pub].MSP_WEB_VIEW_REPORTS where WVIEW_TYPE = 0) and we must remeber about permissions sure)

    but I'm not sure that I am right...
    yes, views in project center and projects views now are available.... but in resource center - no(((


  • Hi DFS, you could try asking Marc on his blog as he is far more familiar with the issue. Not sure why you think you need to add extra views - we are only replacing the defaults. If you are still missing the resource center views then I suggest opening a support incident - this is certainly a bug and there will be no charge.
    Best regards,
    Brian

  • Hey Brian is thr a way to fix for deleted timesheet view. ? One of my administrator deleted My Assignments View for Timesheet and users can now getting :The view failed to load error: All I can do is disable Single Entry Mode and then allow users to create timesheet, but it is not the solution. :) ..

  • So, is this a possible way to set the default view in PS2013 on-prem? (and indeed 2010?)... Br, Ben.

  • I give you a soft workaround, not perfect, but that does the job until CU is released on this matter:
    I removed all field from the Default Views, except the mandatory one (Project name, and ID, Start and Finish for task level).
    I reduced pixel size of these fields to 1, and moved the Gantt Chart bar to 2000 pixels.
    Finally, I created a new Text field name "IMPORTANT - PLEASE SELECT VIEW XXX", where XXX is the View I want my users to use. Then I set the width of this new text field to 1000 (max authorized).
    This way, my users are not bothered with the error message, and they quickly switch to the View I want them to use. All subsequent connexions to PWA will lead them to this view I want them to use, so my default view should only be used once.....
    My 2 cents....

  • Is this fixed in a CU? I can't see details about it in the SP1 notes (but could have missed it)

  • Hi Christopher, should be fixed in April 2014 CU (http://support.microsoft.com/kb/2863881)
    Br

  • Hi,

    April CU 2014 fixed the most of this problems. Only when you go to tasks, the problem still exists.
    Installed June CU 2014 -> Problem still exists.

  • Worth opening a case then FeytensJ - perhaps you are hitting a different issue - view load failure is a fairly generic message and certainly the April fix will only fix the specific issue.
    Best regards,
    Brian

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment