Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Programatic publishing of task resource assignment & enterprise resource calendar updation

Posted on 2006-11-02
Medium Priority
Last Modified: 2013-11-15

I am using Project Server 2003 and I am facing some problem when I am doing following 2 set of operations programatically ..

Set 1 -
1. Task creation - PDS is available
2. Task assignment to a resource - PDS is available
3. Publishing task resource assignment - PDS is available (same as above with autopublish option set to 1) but it is not working.
4. Filling Timesheet - PDS is available

Set 2 -
1. Enterprise resource calendar updation - PDS is not available.

Please help with
Set 1 - 3. Publishing task resource assignment
Set 2 - 1. Enterprise resource calendar updation

Thanks in advance

Question by:mahankali_2001
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 10

Expert Comment

ID: 17884147
1) When the autopublish  do not work - open incident on Premier Support  -in case that this is  MS Project bug incident will be refunded.

2) You probably don't know how to use Administrative Projects :)  

LVL 10

Expert Comment

ID: 17892078
What now, i didn't ansvered your question but i belive that I solved your problem.


Expert Comment

ID: 17945892
I think you may do that using XML and interfacing with PDS.

About the calendars i've done a program to publish the resources calendar and set the non-working days.
Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!


Author Comment

ID: 17946157
Can you please share with me your program. It is one of our urgent requirement for which we don't have answer.

Expert Comment

ID: 17948189
I can't share my program because it belongs to the company. However i can show you the major steps and by this you can implement your own program, ok?

First I have web based application where I collect all the resources non-working days (e.g vacances) and i store them in a SQL Server table.

Next i build an application to execute an publish that non-working days to the resources calendar. This application have been made in VB 6.0 Standard EXE.

First I check if there is an open WINPROJ.exe process, if it exists, I abort my application, else I open my new instance of ProjectServer and keep its handler (check startMSProject function bellow, i really don't remenber but i think that this function was based in some code provided in Microsoft's website) .

MAIN : part of application

'Get the handler of Microsoft Project's Application
    StartMSProject 'Function created to start Microsoft Project
    Set prj = GetObject(, "Msproject.Application")
    prj.FileClose pjDoNotSave

    'if Microsoft Project started without problems...
    If Not prj Is Nothing Then
       maxprojid='get the max proj_id in msp_projects table
       VacationMaps= 'get all the vacations maps that are already approved (business rule ;) )
        Do While Not VacationMaps.EOF
            'now from this resources that have their map approved, check the ones that already have non working day in
            'project server and delete those days
            'Open the actual user pool
            prj.EnterpriseResourcesOpen RSTarefas("utl_cod")
            ssql = "select * from msp_view_res_tp_by_day where ResourceUniqueID=" & VacationMaps("UTL_COD") & " and year(ResourceTimeStart)=" & VacationMaps("MAPA_ANO") & " and ResourceTimeWorkAvailability is null"
            NewRecordSet.Open ssql, conProj
            Set NewRecordSet2= New ADODB.Recordset
            Do While Not NewRecordSet.EOF
                If Weekday(NewRecordSet("ResourceTimeStart")) <> 1 And NewRecordSet(RSProject("ResourceTimeStart")) <> 7 Then
                    'if it isn't weekend ...
                    'check if its holliday
                    ssql = "select cd_from_date from dbo.MSP_CALENDAR_DATA where cal_uid=3 and cd_working=0 and cd_day_or_exception=0 and year(cd_from_date)=" & Year(NewRecordSet("ResourceTimeStart")) & " and month(cd_from_date)=" & Month(NewRecordSet("ResourceTimeStart")) & " and day(cd_from_date)=" & Day(NewRecordSet("ResourceTimeStart")) & " and proj_id=" & maxprojid
                    RSProject2.Open ssql, conProj
                    If RSProject2.EOF Then
                        'if isn't a holliday, then delete that day from the resource nonworking day
                        prj.ResourceCalendarEditDays "Checked-out Enterprise Resources", RTrim(VacationMaps("utl_nome")), NewRecordSet("ResourceTimeStart"), NewRecordSet("ResourceTimeFinish"), , , True
                    End If
                End If

            'Now i will add all the nonworking days to project server
             RSVacations2 = 'Get from database all the vacations days that are approved
             If Not RSVacations2 .EOF Then
                      Do While Not RSVacations2 .EOF
                              prj.ResourceCalendarEditDays "Checked-out Enterprise Resources", RTrim(RSVacations("utl_nome")), RSVacations2("DIA_DATA"), RSVacations2("DIA_DATA"), , False, False
             End If
             Set RSVacations2= Nothing
             'save the application Resource Pool

Function StartMSProject()
Set p = GetObject(, "MSProject.Application")
' Determine whether Project is already running.
If Not p Is Nothing Then
   b = True
End If

'If Project is running, shut down Project.
If b Then
   StartMSProject = Null
   Exit Function
End If

'logon parameters for Project Server
sServer = "http://#Your Server Address#/projectserver"
sServerUser = "#Administrator Login#"
sServerPass = "#Administrator Password#"
sServerString = "winproj.exe /s """ & sServer & """ /u """ & sServerUser & """ /p """ & sServerPass & """"

'Start Project. If you want to start with a Windows logon, remove the /u and /p parameters
'from the ServerString
Shell sServerString

'At this point, fail to an error handler if the application object cannot be created.
'This behavior occurs because the Shell function does not "wait" for the application to start; the code continues
'to execute. Because Project may be busy logging on, the following Set statement may fail. This
'artificial 'loop' gives Project time to finish the logon process.
t = Timer + 60 ' get the current time + 60 seconds
Sleep 60000 'Wait 60 seconds to give Project to finish the logon process.

'get object to project for automation
Set p = GetObject(, "Msproject.Application")
If p Is Nothing Then
   'An Error as Occured... Terminate this function
   Exit Function
End If

End Function

Sorry but this is the best I can do!! I hope it solves your problem! Tell me later if it works!

LVL 10

Expert Comment

ID: 17948666
Set 2 - 1. Enterprise resource calendar updation
It's nice code but you are performing those tasks fromProject Proffesional - and it's problem.

I take ower many MS Project implementationw when competitors failed :)  I noticed that when the there is request to modify resource  calendars customer  approach is ussualy wrong.
90% the customers need  to modify enteprise resource calendard because the people are on vacancy, sick etc.  and  they dont know haw to use  Administrative projects!!

Create te new administrative project create same basic tasks vacancy, sick leave, training ect. and assign all resources from enterprise or same department  to each task.  Information about administrative projects are in documentation.

Set 1 - 3. Publishing task resource assignment

This task can be performed only from Project Proffesional  - It's really difficult to work with Projet Pro on server. You can do it in same night job.
or add event handler to the Enterprice global which publish all resource assignment when the user save project.

GROSSO:Why did you wrote that code? it was same special case which can't be solved by ADM template ?

Accepted Solution

cgrosso earned 1000 total points
ID: 17948948
winzig: It was a special case I need a special workflow to approve the non-working days. I also have tried the Administrative Projects to manage the non-working but there was a some problems about the assignments to the projects, the project plans wasn’t affected… By this way all the resources that are assigned to projects, have their tasks changed according with their non-working time. (Have I done something wrong?)

I'm developing an intranet application that already has several years, for project management and allows users to report several activities that aren't related with PServer. This web application have its own database and when are created projects, users, etc, it communicates with PServer by PDS. This application allows having several templates for the project plans based in the project type. Basically we only use the functionalities of Project Professional and Project Server to create and manage the project plans.

Now I’m preparing specifications for a new intranet in J2EE that is independent of the EPM (e.g. RPM, PS2007, PS2003) that the organization uses and will be based on SOA. I’m expecting a lot of difficulties, but I think that will be just perfect!
LVL 10

Assisted Solution

winzig earned 1000 total points
ID: 17949945
cgrosso:The task isn't affected but you will see that  resource is overloaded.

it sound like nice implementation: Our ussual mps implementation is project centric for PMO.  But this year have 2 implementations s where  the projects was created from NAVISION, and MPS  sending requests to material resources to NAVI, and Navi  sending back informations about availability.(when the material isn't awailable in time task is  higlighted and PM can resolve this problem in project plan). ......  

The Projects managerss will be happy when you told them that MPS will be replaced by J2EE Intranet based on SOA  :)
, but normal people(resources) don't care about EPM and they will be  happy when you give them same cool  collaboration application  like Worksite from Interwoven. Where they can share all informations about business case even when they are offline.
LVL 30

Expert Comment

ID: 18106277
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup topic area:

Split - winzig, cgrosso

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

EE Cleanup Volunteer

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Online collaboration is quickly becoming embedded in the workplace, and its benefits are tangible. See what the current landscape looks like and what the future holds for collaboration tools and the future of work.
"Disruption" is the most feared word for C-level executives these days. They agonize over their industry being disturbed by another player - most likely by startups.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question