none
ProjectUID selected from the reporting database from Project Server OnPublished event is taking some delay RRS feed

  • General discussion

  • Hi all,

    I'm invoking a stored procedure from the reporting database from the project server onPublished event.  I'm having some issues in getting the details of that particular project from the published event handler.  This i noticed that there is some delay is taking place in moving the data(project uid )  from the published to the reporting database .

    My stored procedure select statement is as follows:
    SELECT ProjectUID, ProjectName FROM MSP_EpmProject_UserView
     WHERE ProjectUID=value
    This stored procedure is invoked from the onPublished event of the project server event handler where that particular projectuid is passed in that stored procedure.I have noticed that some delay is taking palce to move  the data into the reporting database.  My stored procedure got invoked from the onPublished event of the project server event handler before the delay is complete.  So the row selected from the stored procedure is alwys zero (0).  Is there any other method to wait for repoting database to get refreshed. Please help me .

     

     

    Wednesday, November 19, 2014 12:21 PM

All replies

  • Hi,

    The Reporting sync action is the last one, after the project is published. Maybe you can update your action and use the Reporting > ProjectChanged / ProjectCreated.

    Any particular information you are looking for? As it may be an easier way to get that information

    Paul

    Wednesday, November 19, 2014 1:04 PM
  • Hi Paul,

    I'm new in to this project server. Thanks for the information. Is there a way to forcefully checkin a project on the published event.  Actually my intention is to update the customfield.  In order to get the data for the new I'm querying the infirmation from the reporting database table.

    When i tried to checkout or queueupdate I'm getting the exception as .

    The exception getting on checkout and queueupdate is as follows.  I removed the checkout exception by checking if the project is already checked out. Still I'm not able to update using the queueupdate as the same exception is getting . Is there any way to checkin that project?

    LastError=CICOCheckedOutToOtherUser Instructions: Pass this into PSClientError constructor to access all error information

    when i commented the line checkout and queueupdate then it is gettign the exception in the queuecheckin

    Queuecheckin

    ProjectServerError(s) LastError=GeneralSecurityAccessDenied Instructions:

    Please let me know do we need to checkout the project in the onPublished event for updating the custom field.

    Wednesday, November 19, 2014 1:44 PM
  • Hi,

    I would suggest not to force check in the project as the user may publish the project couple of times before checking in. I think it would be better to implement the waitforqueue

    http://msdn.microsoft.com/en-us/library/microsoft.projectserver.client.projectcontext.waitforqueue.aspx

    and run when the project is checked in, waitforqueue for the job to complete and then execute your code and you will need to:

    - checkout project

    - update

    - publish

    -check back in

    Hope this helps

    Paul

    Wednesday, November 19, 2014 2:13 PM
  • Hi sabithad,

    The issue you are facing is because of the conflict of permissions, event handlers always works through administrative user credentials whereas the project is open in edit mode by the logged-in user. And you are tyring to update custom field at the back end with Administrative credentials, while project queue is in process by logged-in users credentials. Its not gonna work this way :) 

    The best option is to use Javascript on your PDP using CEWP, you can either build your complete logic in JavaScript and place that code on your PDP. OR you can use the combination of JavaScript and PSI and create a webpart to be placed on PDP.

    below blog link willgive you directions to go ahead with, but for sure the solution to your query is JavaScript :)
    http://epmxperts.wordpress.com/2012/05/21/generate-unique-id-for-project-using-a-webpart/

    hope this helps.


    Khurram Jamshed - MBA, PMP, MCTS, MCITP ( Blog, Twitter, Linkedin )
    If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”.

    Thursday, November 20, 2014 2:55 AM