QueuePublish does not refresh calculated custom fields

J

Jono

Hi all,

If I create a new enterprise calculated custom field I noticed that the
calculation is not processed until the project is re-published using project
Pro 2007.

I have writtern a service that re-published a set of projects every day with
the intention of forcing a re-calculation of the custom fields. I am using
the QueuePublish method (with a FullPublish) of the Project Web Services to
re-publish projects. There are no errors in the queue and everything seems to
be working. However, the custom fields values on the re-published projects
are not being refreshed....If I use Project Pro to re-publish the project the
Custom Fields are refreshed !!!

Any Idea's

Thanks in advance for any reply's.
 
S

Stephen Sanderlin

QueueUpdateProject() triggers a recalculation of custom field formulas,
not QueuePublish(). All QueuePublish() does is move data from Draft to
Published... if you're not updating the Draft data, then a Publish won't
have anything new to move.

The reason it works when you publish from Pro is because Pro
recalculates the formulas, Saves to Draft, and then Publishes. You need
to go through the same process using the PSI.

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com
 
J

Jono

Thanks for that...

I'm coding this now and after some learning I have come up with the
following. However it blows on the QueueUpdateProject with the following
exception...

System.Web.Services.Protocols.SoapException: There was an exception running
the extensions specified in the config file. ---> System.Web.HttpException:
Maximum request length exceeded

The Code is.....

//Load the Project Details
ProjectWebSvc.ProjectDataSet projectDs =
project.ReadProject(projectGuid,ProjectWebSvc.DataStoreEnum.WorkingStore);

//Checkout the project
project.CheckOutProject(projectGuid, Program.sessID, "Checked Out by Project
re-Publishing Tool");

//Make the Task Name Dirty
projectDs.Task[1].TASK_NAME = projectDs.Task[1].TASK_NAME;

jobGuid = Guid.NewGuid();
project.QueueUpdateProject(jobGuid, Program.sessID, ProjectDataset, false);
WaitForQueueJobCompletion(jobGuid, 13);

//Force Check in project
jobGuid = Guid.NewGuid();
project.QueueCheckInProject(jobGuid, projectGuid, true, Program.sessID,
description);

//Wait for Queue Process to complete
return WaitForQueueJobCompletion(jobGuid, 11);
 
J

Jono

Stephen Sanderlin said:
QueueUpdateProject() triggers a recalculation of custom field formulas,
not QueuePublish(). All QueuePublish() does is move data from Draft to
Published... if you're not updating the Draft data, then a Publish won't
have anything new to move.

The reason it works when you publish from Pro is because Pro
recalculates the formulas, Saves to Draft, and then Publishes. You need
to go through the same process using the PSI.

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com
 
J

Jono

Ignore the typeo i made in the example call to QueueUpdateProject it is coded
as....

project.QueueUpdateProject(jobGuid, Program.sessID, projectDs, false);
 
J

Jono

Ok.

I now have QueueUpdateProject working. No Errors and the Queue looks happy.
However, the Calculated Custom Fields are still not being refreshed
(Re-Calculated).

The Steps I follow are...

1. Get a ProjectDataSet
2. Make some Changes to the Project Title
3. Create a new Dataset and apply the modifications made to the origional
dataset (This resolved the exception)

4. CheckOut the Project
5. Update the Project (QueueUpdateProject )
6. CheckIn the Project
7. Publish the Project

Any Idea's......

P.S Many thanks for your input so far :)
 
J

Jono

Regarding refreshing Custom Fields using the PSI.

We have a situation where a Project manager creates a new Calculated Project
Custom Field and adds it to a View. All projects that have not been republish
via Project pro have empty values in the new custom field. However when you
republish with Project Pro the calulation is fired and the custom field
contains a value.....Very Simple.

The problem is when you want to refresh projects is Project center using the
PSI. QueuePublish or QueueUpdateProject does not refresh / Recalulate custom
fields.

The reason why it does not refresh against a project is because the
assocoation between the Project and the master custom field has not been
made. Project Pro automaticaly creates a new association when you publish a
project.

So... You need to check which custom fields have been associated to a
project and then Add missing custom fields using QueueAddToProject...

If anyone knows of another way PLEASE let me know.....Hope this helps...

Jono
 
S

Stephen Sanderlin

Ah... okay... this changes things.

If you are creating a new custom field, you are correct that you need to
create a new field in the project first. As far as I am aware, there is
no other way to do this beyond creating the field in the Project using
the PSI or using Pro.

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com
 
J

Jono

Hi,

I can now refresh SOME projects custom fields.

I investigating an issue when a project level custom field is a formula base
and its formula uses a Task level custom field. My current thinking is that
the PSI call to QueueAddToProject iterates through a custom field
dependency.... IE all dependant custom fields must be assigned to a project
before the parent custom field is assigned.

I believe this to be the case as I can only assign a project level formula
based custom field to a Project if all the dependant project level custom
fields have been created. So my code now assigns all static project level
custom fields to a project before if assigns Indicator / Formula project
level custom fields..... This works.
This is the case for Sharepoint that is all child custom fields of a formula
field need to be created prior to creating the formula field.
Any input / ideas would be great full... As I am fighting a delivery clock
and I am way behind :(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top