none
How to programmatically perform a sync operation to cause resource costing to update for projects RRS feed

  • Question

  • Hi,

    I'm new to MS Project and Project Web Access. I'm trying to accomplish something programmatically that I can demonstrate using the PWA web site but cannot navigate my way thru the API to figure it out.

    Basically, I need to make sure that when a resource for a project has their cost updated, this should get reflected in the project(s) they work on.

    I manually did this by updating the cost of a resource and then went back to the project to check it. When I did, PWA said the project was out of sync. So, I clicked the Sync link to sync the project. When I did and then subsequently saved/published the project, I could see that the project cost for that resource had been updated as expected.

    I've tried scouring the ULS logs, etc to try and reverse engineer what PWA is doing to make this happen. However, I've not been very successful in mapping this to actual API calls I can find.

    I am using Project Server 2010/PWA 2010. Can anyone point me in the right direction?

    Thanks!

    Friday, June 22, 2012 7:41 PM

All replies

  • Hi !

    If I right, you would like update "Standart Rate" project field for enterprise resource (resource in Project Center) ? And from business point of view you probably would like to have differene "standart rates" for different tasks (or projects) but for the same enterprise resource ?


    Vadim Gerya, PMP

    Saturday, June 23, 2012 9:52 PM
  • I am simply updating the standard rate for a resource and wanting to see that new rate reflected in the project schedule for a project on which the resource is assigned. I can do this via the PWA web site, but I need to do this programmatically.

    What I have discovered so far is that when I execute the sync via the UI, I see various WCF requests generated on the back end. The one that seems to be the trigger for the entire behavior is a post to the pwa.svc WCF service with an action of

    'http://schemas.microsoft.com/office/project/server/webservices/PWA/ProjectSyncProjectEnterpriseEntities’

    This appears to fire off a bunch of other queue messages that are all related to SyncProjectEnterpriseEntities. Eventually, I see a queue job named "Update Scheduled Project" which is generated from this process.

    In searching around, I can't find any method/message/etc named "ProjectSyncProjectEnterpriseEntitites" or any of these related artifacts.

    Any help would be greatly appreciated.

    Jim

    Tuesday, June 26, 2012 8:48 PM
  • As i found, if project not Synced, in top appears button "Sync" on red div.

    On pressing this button works this JS code:

    xmlhttp.open('POST', PJ_GetPSIUrl(webServiceName, pwaSitePath), bAsync);
    xmlhttp.setRequestHeader('Content-Type', 'text/xml; charset=utf-8');
    xmlhttp.setRequestHeader('SOAPAction', soapAction);
    xmlhttp.setRequestHeader('AsmxRoutedCall', 'true');
    xmlhttp.send(request);

    Value of request is:

    <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ProjectSyncProjectEnterpriseEntities xmlns="http://schemas.microsoft.com/office/project/server/webservices/PWA/"><projectUid>{11c6028a-326b-4775-bcc1-04e30cb78fac}</projectUid><sessionUid>{a362c35b-d6ee-4303-97f2-c23f80c60da3}</sessionUid><autoCheckin>false</autoCheckin></ProjectSyncProjectEnterpriseEntities></soap:Body></soap:Envelope>

    So i think you can make this SOAP-request to the service to sync project entities (resources & calendars).

    Monday, March 21, 2016 7:34 AM