Archive for August, 2011

Recently i had a question where in users didn’t wanted to get redirected to workflow status page, every time you submit or even when you hit save on the first PDP page, rather they wanted to get redirected to a new page, but should retain the project UID for reference

Easy workaround use java script get the query string and redirect it, so how do you do it, here you go

1. Create a new PDP page
2. Set its property to be used as workflow status page
3. Edit the page and insert a content editor web part there
4. Edit the HTML for the content editor and paste the code below

Note :: be cautious as soon as you save the page and it reloads you wont be able to edit it again as it would by default redirect, hence make sure you put some condition like if projUID <>’000000000000′ or something to keep it editable 🙂

<script type=”text/javascript”>
var ProjUID =”;
URL = window.location.search.substring(1);
Array = URL.split(“&”);
for (i=0;i
  Parameter = Array[i].split(“=”);
   if (Parameter[0].toLowerCase() == “projuid”)
     ProjUID = Parameter[1];
var Redirectionstring = “https://ServerName/pwa/project%20detail%20pages/newRedirectedPage.aspx?projuid=” + ProjUID;

location.href =Redirectionstring ;

6. Navigate to Workflow Stage Settings in Server Settings
7. For the appropriate stage change the workflow stage status page to the newly created page

And viola youa re done 😉 



Read Full Post »

Another Great post, though a little late but yes desperately wanted, how to hook up your custom actions when a user hits save button on PDP page, typical scenario, you want to capture additional custom data and dont want to use Enterprise Custom Field for everything (Practically not possible) 🙂

So here you go read this article  : http://blogs.msdn.com/b/husainzgh/archive/2011/08/01/hooking-into-the-project-detail-page-ribbon-save-button-without-overriding-out-of-box-functionality-in-project-web-access-for-project-server-2010.aspx

Read Full Post »

Bulk Update Enterprise Resource Pool resource properties using macro, read data from excel sheet and update in ERP

* Add reference to Microsoft. Excel. Application
* There has to be a common identifier between excel sheet column and ERP for matching purpose

Sub ReadResourceValueFromExcelAndUpdateResourceGlobal() 
'Declare strings / integers to be used in procedures
Dim MatchValue, ProjectServerResourceName As String
Dim xlResource As Integer

'Declare Object Variables for use
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet

'Set Excel Application, Workbook, Worksheet reference to be used
Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Open("C:\Users\sunilsingh\ResouceList.xlsx", False, True)
Set xlSheet = xlBook.Worksheets(1)

'Declare and Set Resource to be used from current Global Resource Sheet
Dim res As Resources
Set res = ActiveProject.Resources
Dim r As Resource

'Loop thorugh Excel Sheet get values and find in Global Resource Sheet and do the operation

For xlResource = 1 To 100 'no of resources in xl sheet or you can use Sheet.row count

 MatchValue = xlSheet.Cells(xlResource, 3).Value
 ProjectServerResourceName = xlSheet.Cells(xlResource, 2).Value
 If MatchValue <> "" Then
 For Each r In res

 If LCase(r.WindowsUserAccount) = LCase(MatchValue) Then
 x = MsgBox("Match Found" + vbCrLf + vbCrLf + r.WindowsUserAccount + vbCrLf + r.Name, vbInformation)
 ' Update Resource properties / values in Resource Global
 r.Name = "Sunil US Account" 'ProjectServerResourceName
 r.RBS = "xxx/xxx/xxxxx/xxxxx" ' note the separator char use as you have set in your CF
 r.HyperlinkAddress = "https://Servernaem/person.aspx?accountname=sunilsingh"
 x = MsgBox("Resource Data Updated" + vbCrLf + vbCrLf + r.WindowsUserAccount + vbCrLf + r.Name, vbInformation)
 End If
 Next r
 End If
Next xlResource

' Clear Memory / Clean Up
Set xlSheet = Nothing
Set xlBook = Nothing
Set xlApp = Nothing

End Sub

Read Full Post »