Project Programmability

This blog focuses on customizations and programming for Project Web App, Project Server, Project Professional and Project Standard. Includes User Interface (UI) customizations, Project Server Interface (PSI) and Visual Basic for Applications (VBA) Programming. It also covers Business Intelligence.
 
 

April, 2011

  • Project Programmability and Business Intelligence

    Learn How To Build a Silverlight App for PWA. . .

    • 0 Comments

    . . . which is, after all, a SharePoint application.

    See the SharePoint and Silverlight Training Course. It includes 30 hands-on labs, including labs on accessing data through WCF services.

  • Project Programmability and Business Intelligence

    Reading Enterprise RBS values: the Easy Way and the Not-So-Easy Way

    • 2 Comments

    There are a couple of ways to programmatically get the Resource Breakdown Structure (RBS) value for a Project Server user. The simplest way is to query the Reporting database, for example:

    SELECT [ResourceUID] ,[ResourceName] ,[ResourceBookingType] ,[ResourceIsActive] ,[RBS] FROM [ProjectServer_Reporting].[dbo].[MSP_EpmResource_UserView] AS res WHERE res.ResourceName = N'Linda Jones'

    The result on my machine is:

    ResourceUID

    ResourceName

    ResourceBookingType

    ResourceIsActive

    RBS

    0D455775-01CB-42E1-A481-A6F0F1F8208A

    Linda Jones

    0

    1

    User Assistance.DevDocs.SDK Writers

    To get the RBS by using the PSI is a bit more work. Because the RBS is an enterprise resource custom field that uses the RBS lookup table, you can use the following steps:

    1. Call the ReadResources method and filter the primary Resources table for the user name and GUID. Alternately, you can use the ReadUserList method to get all of the active resource names and GUIDs, and iterate through the ResourceDataSet for the specific resource. The attached example uses the –userList command line argument to have the application use the ReadUserList method, and displays the elapsed time for the method used.
    2. Call ReadResource with the resource GUID to get the full ResourceDataSet.
    3. Iterate through the ResourceDataSet.ResourceCustomFields table to get the CODE_VALUE for the RBS custom field (if it exists).
    4. Use a filter with the ReadLookupTables method to get a LookupTableDataSet that contains only the LookupTableTrees table for the RBS lookup table.
    5. Iterate through the LookupTableTrees table to get the LT_VALUE_FULL string that corresponds to the CODE_VALUE in the RBS custom field.  The LookupTableTrees row where the LT_STRUCT_UID element matches the  custom field CODE_VALUE contains the correct RBS string.

    The attached example also writes the various datasets to XML files, for debugging purposes. Keep in mind that the app user must have the ManageUsersAndGroups global permission, and the other permissions specified in the SDK topics for the methods used, in order to read data of other resources.

    The attached ReadRBS.zip file contains the complete Visual Studio solution for the example described in this post. To use the sample, change the server name and Project Server name for the endpoint addresses in the app.config file. The sample uses the WCF interface for Project Server 2010; however, it can be adapted to use the ASMX interface for Project Server 2007.

    For example, the following command gets the same RBS value shown by the Reporting database query:

    C:\Test>ReadRbs -name "Linda Jones"

    XML output from ReadResources:
            C:\Project\Samples\Output\RBS_ReadResources_UserInfo.xml

    Using ReadResources method: 412.309 milliseconds

    XML output from ReadResource:
            C:\Project\Samples\Output\RBS_ReadResource_FullUserInfo.xml

    XML output from ReadLookupTables:
            C:\Project\Samples\Output\RBS_LookupTable.xml

    User name: Linda Jones
            GUID: 0D455775-01CB-42E1-A481-A6F0F1F8208A
            RBS value: User Assistance.DevDocs.SDK Writers

    Press any key to exit...

  • Project Programmability and Business Intelligence

    Trials and Tribulations in Customizing the Project Center Ribbon

    • 0 Comments

    The How to: Modify the Ribbon in PWA article in the Project 2010 SDK works for the cases in the article, but in other cases, you can get a JavaScript error when you try to hide some ribbon controls in PWA. For example, if you hide the Zoom and Show/Hide groups in the Project Center ribbon, a JavaScript error occurs while debugging the Visual Studio project, and all of the ribbon controls are disabled on that page. The error occurs only for controls in the Show/Hide group.

    Here is the standard Project Center ribbon. The Visual Studio 2010 project that hides the Zoom group and the Show/Hide group is in the attached ProjCenter_Hide2Groups.zip file.
    ProjCenter_Default

    Here is the solution for the Project Center ribbon customization issue - at least with three of my machines, all of which have Internet Explorer 9, with both 32-bit and 64-bit IE. I did not test with IE8. The problems may be solved, or may be different, with future updates or different versions of Internet Explorer.

    1. Make sure you are running IE9 RTM (9.0.8112.16421). 

      On my Windows Server 2008 R2 machine, there was an earlier IE9 RC (9.0.8080.16413) build installed. When the ribbon customization feature was deployed, all of the ribbon controls were disabled on the Project Center page. When debugging in IE with F12, the Script tab shows:

      SCRIPT5022: Attempting to attach to Id: Ribbon.ContextualTabs.ProjectCenter.Home.ShowHide but this id is not present in the DOM
      cui.debug.js?rev=seEKIhJXfBClfYcr46fd3w%3D%3D, line 1282 character 13

    2. On Windows Server 2008 R2 (the development machine), open Internet Options in IE. On the Security tab, make sure that Enable Protected Mode is checked. If you change that option, restart IE.
      If the Enable Protected Mode option is not checked, all of the ribbon controls on the Project Center page are disabled, and the script error shows in the F12 IE debugger. With the earlier build of IE9, it didn't matter - the ribbon controls were disabled for Enable Protected Mode checked or unchecked.
      ControlsDisabled
    3. Note:   When viewing the Project Center page in IE9 on Windows 7 64-bit, it doesn't matter whether the Enable Protected Mode option is checked or not - the ribbon controls are enabled as expected:
      ControlsEnabled
    4. When you are developing the ribbon customization in Visual Studio 2010, test hiding controls one-by-one, before hiding an entire group. Run F5 after each change, to see the effect. That is fairly quick to do by using F5 in Visual Studio. For example, hiding the three Navigate controls works fine in the VS debugger, but hiding either of the ShowHide group controls results in the following error, as shown in the Visual Studio debugger. The error is in the dynamic cui.debug.js script:
      $3v: function() {ULSpEN:;
              var $v_0 = $get(this.$6_0);
              if (!CUI.ScriptUtility.isNullOrUndefined($v_0)) {
                  this.set_$2($v_0);
              }
              else {
                  throw Error.create('Attempting to attach to Id: ' + this.$6_0 + ' but this id is not present in the DOM');
              }
          },
      ProjCednter_VSError
    5. Break if you get that error, exit IE, and you can still deploy the solution and try it outside of the Visual Studio debugger. In the Solution Explorer, right-click the project, and then click Deploy. In my case, the ShowHide controls were hidden, and the ribbon controls were enabled as expected – so long as the Enable Protected Mode is checked in IE, and IE9 is the RTM build.

    I don't have an explanation of why this happens, but the previous steps are what works (on my machines – the famous WOMM test). You might find different issues, depending on your software versions and whether the Sun is having a coronal mass ejection that day. I suspect it is a combination of problems of the Javascript implementation in the Internet Explorer build version (naturally, it couldn't be Project Server's problem!).

  • Project Programmability and Business Intelligence

    Upcoming WebCast: Project Server Development for SharePoint Developers (Level 300)

    • 0 Comments

     

    Let me highlight the following webcast that we conduct Thursday, May 05, 2011 8:00 AM (GMT-08:00) Pacific Time. Make sure to register now to get automatic reminder!

    MSDN Webcast: Project Server Development for SharePoint Developers (Level 300)

    Language(s): English.

    Product(s): Microsoft Project 2010

    Audience(s): Pro Dev/Programmer

    This webcast covers the Microsoft Project Server development features from a Microsoft SharePoint developer's perspective. We explain the logical architecture of Project Server in a SharePoint farm and compare the development features. We also give real world examples such as the ribbon UI, Windows Communication Foundation (WCF) server programming, web part with JS Grid, Workflow for Demand Management, and cmdlets for Windows PowerShell. The key takeaway is for SharePoint developers to understand the similarities in development to be able to join the Project Server developer community.


    Presenters: Steven Haden, Senior Consultant, Microsoft Corporation and Olivier Laymand, Senior Consultant, Microsoft Corporation


    Steven Haden is a senior consultant working for Microsoft Services in France. He is involved in large Microsoft Project Server and Microsoft SharePoint deployment. Steven is interested in both the architecture and the development of solutions and is the author of the white paper "Hitchhiker's Guide to Demand Management" (http://go.microsoft.com/fwlink/?LinkId=200608).


    Olivier Laymand is a senior consultant from Microsoft Services working on large Microsoft SharePoint and Microsoft Project Server deployments. He's involved in solution architecture definitions, development of best practices, and governance.

  • Project Programmability and Business Intelligence

    Project Developer Curriculum and Project Development for SharePoint developers

    • 0 Comments

    To help Microsoft SharePoint 2010 and Project 2010 developers conveniently find all relevant resources for Project 2010 development we have created unified information center “Project Developer Curriculum” that references all key resources – from blogs, SDK chapters, SDK code samples, Solution Starters to extensive list of on demand webcasts.

    This addition to strong Project Developer Center also talks specifically to SharePoint developers offering development approach comparison. We are preparing a separate webcast dedicated to this topic MSDN Webcast: Project Server Development for SharePoint Developers (Level 300) - Thursday, May 5, 2011 at 8:00 A.M.–9:30 A.M. Pacific Time (subject to change). Make sure you register now to get the reminder before the webcast!

    Q&A

    Q: What are the key resources for Project 2010 Developers
    A: Project Developer Curriculum is an awesome unified resource –in addition - Project Developer Center and SDK http://msdn.microsoft.com/project/ and Project Programmability blog http://blogs.msdn.com/project_programmability/  are great information resources.

    Q: Any ‘quick start’ type of technical training for Project 2010?
    A: Here you go http://www.microsoft.com/project/en/us/quick-start-training.aspx!

    Q: Is there any Project 2010 Demo Image?
    A: Yes, it’s available as Project 2010 Demonstration and Evaluation Pack for the 2010 Information Worker Demonstration and Evaluation Virtual Machine and as hosted experience as well - http://technet.microsoft.com/en-US/evalcenter/ee410540.aspx. Make sure to check the following recording for details.

    Q: Any additional generic Project 2010 resources?
    A: Product information, forums, partners, videos, training and learning resources and many more here.

    Thanks Steven and Jim for you contribution!

Page 1 of 1 (5 items)