Publish all projects in Project Online using PowerShell
So I ended up writing one myself and uploading it on TechNet for rest of the world. You can directly download the script from this link
https://gallery.technet.microsoft.com/Publish-All-Projects-in-ad8ee80e/file/174745/1/Publish_All_Projects_ProjectOnline.ps1
Best practices for writing JavaScript for Project Online – Part 5
Write values to PDP input fields.
If you have followed my previous blog, you’d know how to tap an input field value on a PDP. Once you get hold of it, you can perform many operations like hide it, lock it, move it etc. using simple JavaScript operations.
In one of my apps, I was a bit surprised to learn that setting a field value programmatically e.g. (‘#YXZ’).val(‘123’) wasn’t sufficient for a PDP to detect that an input value has changed and it should save the value back to project when the save button is pressed.
So to simulate the experience as if an end user has typed the value. I had to trigger the JavaScript change event. This then successfully forced PDP infrastructure to save the value back to project.
TypeScript code to write values back to PDP is following.
You can also download the code from
https://gist.github.com/hammadbinarif/6a3312528040f717a510c0a3d0f55df0
Best practices for writing JavaScript for Project Online – Part 4
Read input field values on a PDP
Sometimes, in our script we need to know the values of custom fields to render our own output. Case in point, I once had to draw cool d3.js based graphics representing project status based custom field values. See the sample output below
Now I could have read the values from Project Odata endpoint /_api/ProjectData/Projects but the requirement was to update the graphics as soon as user changed those values. I’ll probably share some other key aspects of this script (rendering graphics and updating it when user changes it) in a different future blog. The focus of this blog is the piece of code that I wrote to read input field values.
The input field values are displayed as editable input boxes if a project is in edit mode. As shown in the screenshot above.
In non-edit mode, the fields are displayed as simple text values inside a DIV tag which in turn resides inside a TD tag. However, even in edit mode, there are cases where fields would be displayed as simple text, e.g. when a field is a calculated field or it is locked in the current workflow stage etc. see output of non-edit mode below.
- The code is in TypeScript but could easily be transformed to JavaScript. I highly recommend using TypeScript for any medium and large sized scripting apps.
- It depends on JQuery
- If in future, Microsoft changes the HTML Dom structure of a PDP page, the code will likely break and will require an update.
Best practices for writing JavaScript for Project Online – Part 3
Create dummy console object to avoid script error in Internet Explorer
One common issue I face with Internet Explorer version 11 and below is that If I my code uses console object for diagnostics, it blocks the execution of rest of the script.
Interestingly, if I open a debug console (by pressing F12 or right click -> Inspect element), the script executes just fine without any error message. After some google search it turned out that IE does not have a console object defined if a console window is not already open. See this stack overflow question for details
https://stackoverflow.com/questions/10183440/console-is-undefined-error-in-ie9
To avoid this error simply add these lines at the start of your JavaScript code. This will create a dummy console object if the real console object doesn’t exist already.
Best practices for writing JavaScript for Project Online – Part 2
Checking the Project details page edit mode
The tip is about changing script behaviour based on the fact that project is editable or not.
I recently created a custom editable grid for user to enter project financial information. However, I wanted the grid to behave like regular PDP input fields which does not allow editing if the project is not in Edit mode. See the output of my grid in Edit and non-edit mode.
When PDP is in edit mode
When PDP is not in edit mode
On every PDP, project online PDP infrastructure injects a global object named EditState which exposes some useful information about the current edit state of the PDP. One of its property EditState.Editing is set to true when the page is in edit state. See the following example code.
In the next part of this series, I’ll talk about how we can avoid a common Internet Explorer error
Best practices for writing JavaScript for Project Online – Part 1
Checking the Web Part page design mode
In this series of blogs, I’ll share some the practices I use to write better JavaScript to customise Project Online screens.The first tip is about detecting the web part page edit mode. Frequently, we write scripts to manipulate UI of the page and if the user is already editing the page, our script can cause undesired behaviour.
We could either execute a different set of functions or at minimum, just not execute the script in design mode to keep the user experience clean.
Its relatively simply to detect the WebPart page design mode. Just add the following code to the startup your script.
In the next part of this series, I’ll talk about how we can detect if a Project Details Page is in Edit mode.
How much can you over allocate a resource in resource plan?
I was giving Resource plan feature demo to a customer and out of curiosity, customer asked if I can assign 1,000 days of work to a resource on a single day. It turned out we couldn’t. When you press Save after assigning 1,000 days of work the system gave the following error.
“Your updates were not saved because of the following reasons: General error: Work value used is invalid. (Use this error information along with other errors to find out the cause of the problem.)”
The behaviour was same for generic resources. And this raised the inevitable question from customer. “How much can I over allocate a resource on a given day in the resource plan?”
3 minute guide to Department field usage
Here is a very brief summary of how Department field is commonly used in Project Online, Project Server 2013 and Project Server 2010. You need to have some values in “Department” lookup table to get any advantage from it.
1- Filter custom fields in a Project.
Assign a department to a Project level Custom field, then create a new project and assign the same department value to Project Departments field. The custom field will only appear in your newly created Project.
2- Filter resource level custom fields for Resource.
Assign a department to a Resource level Custom field, then create a new resource and assign the same department value to Resource Departments field. The custom field will only appear for your newly created Resource
3- Show EPTs only to certain users.
Assign a department to an EPT. Assign same department value to a Resource in Resource Departments field. Only that resource will see the EPT as an available option to create the new project from.
Department fields are also utilised to filter OLAP cube data, Portfolio Analysis business drivers and driver prioritisations. If you really want to learn more about department field, check out this article by Treb Gatte.
http://blogs.technet.com/b/projectadministration/archive/2010/03/17/departmental-custom-fields.aspx
Did you read this blog in in less than 3 minutes? Let me know in comments and I’ll update the blog title :)
Project Online – SSIS OData Replication – Lessons Learned
I recently got a chance to work on an SSIS Package in Windows Azure environment which periodically retrieved the Project online data via OData connector and stored over an Azure SQL Database for SSRS based reporting.
Here are some of my takeaways from this exercise.
Effective Project, Portfolio & Work Management, Using SharePoint
SharePoint 2013 has some exciting new features around Project Management. I delivered a webinar on this topic last Wednesday. Check the full webinar recording below on YouTube.
Filter SSRS Report on Project Site
[Populate SSRS Report Parameters via JavaScript]
Requirement
Display a Project specific data on a Project Site using an SSRS Report.
Solution
SSRS Report can be displayed on a SharePoint web part page using Report Viewer Control. The Challenge was to populate the parameter with Project Name so that only that Project specific data gets loaded in SSRS Report.
Our familiar hero, JavaScript came to the rescue again, though it took some help from Text Filter Web Part this time. Following are the steps
Project Online – What it does and doesn't do.
Project Server 2013 – Reporting Story
Introduction
The latest version of Project Server (i.e. 2013) has introduced some new reporting methods. In addition, reporting possibilities of Microsoft Hosted version of the project Server (i.e. Project Online via office 365) is not exactly same as its on-premise counterpart and hence it is essential to analyse, plan and architect reports according to its deployment scenario.
This article summarises the key reporting capabilities of Project Server 2013 for both on-premise and hosted solutions.



