locked
Project Server - ERP / PSI / Cost RRS feed

  • Question

  • Hi,

    I'm actually working on a project to integrate financial data into Project Server COST. The goal is to have a quick overview of Budgeted / Actual Cost with the standard analysis tool from EPM (Analysis Service using timephased cube).

    My question is what's the best way to update Cost data coming from our ERP but without using macros...? I would like to use PSI to update " task_act_cost" but I always get the folowing error "id='1050' name='ProjectCannotEditCostResource'" (with the project check out).
    Or is it another way to do this?

    Thank in advance.

    Jean-Yves

     

    Monday, August 16, 2010 2:42 PM

Answers

  • Hi kkmick,

    Unfortunately I  didn't get any good answer.
    Using PSI, it's only work if you want to updata Task Cost without assignement... So the only solution I have at the moment is to update Cost with a VBA macro... but I hate this solution! (because need to have a server/computer which call MS Project to start the macro, and for me, this is not professional. And as I readed, Microsoft doesn't support, on server side, Office automation)

    see http://support.microsoft.com/kb/257757/en-us :

    Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

    K.R.

    Jean-Yves

    Thursday, September 2, 2010 9:50 AM

All replies

  • Hello Jean-Yyes Hug

    If  you are going to push costs into Project Server, then you need to UNCHECK the "Actual Costs are Calculated by Microsoft Project".  This is found in the OPTIONS and CALCULATION tab.

    Personally, I would not update project with costs. I would let Microsoft calculate it's costs based on it data and let your ERP calculate based on its data.  My approach would be to query both data bases (ERP and Project) to determine the information you are looking for.

    Cheers!

    Michael Wharton, MBA, PMP, MCT


    Sincerely, Michael Wharton, MBA, PMP, MCT, MCSD, MCSE+I, MCDBA www.WhartonComputer.com
    Tuesday, August 17, 2010 5:16 PM
  • Hello Michael,

    Thank you for the answers.
    The reason to use Actual Cost field is to be able to use Standard reports/cubes. We don't want to redevelop report or cube for that because EPM report's are really fine for us.

    I will check your first solution, but I saw yesterday that I'm only able to change Actual Cost with PSI when the is NO Cost ressource assigned to the task. Is this normal?

    Thank you!

    Jean-Yves

    Wednesday, August 18, 2010 6:25 AM
  • Hi Jean-Yves:

    Did you ever get an answer?  I am trying to update resource cost within an assignment using psi.

     

    Thanks,

    kkmick

     

    Wednesday, September 1, 2010 1:16 PM
  • Hi kkmick,

    Unfortunately I  didn't get any good answer.
    Using PSI, it's only work if you want to updata Task Cost without assignement... So the only solution I have at the moment is to update Cost with a VBA macro... but I hate this solution! (because need to have a server/computer which call MS Project to start the macro, and for me, this is not professional. And as I readed, Microsoft doesn't support, on server side, Office automation)

    see http://support.microsoft.com/kb/257757/en-us :

    Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

    K.R.

    Jean-Yves

    Thursday, September 2, 2010 9:50 AM
  • Hi Jeans-Yves:

    That is exactly what I thought.  I have been looking around for a good answer.  Spend a lot of time on it.  A project server person was telling me to use material resource instead of cost resources.  That should work according to him.  I have no luck so far yet.  I ran into exactly the same problem. I will let you know if I find a better way to do it. 

    How are you using vba macro to update cost in project?  Is it possible for you to post some code?  I am not that familiar with vba macro.

     

    Thanks

    kkmick

     

    Thursday, September 2, 2010 12:16 PM
  • Hi kkmick,

    I found really crasy that's not out of the box in PSI... I hope that microsoft will add this functionnality soon.

    I'm also not expert in VBA code (I doesn't like it...) here is the code:

    Sub SyncISTCostToActualCosts()
      'Params
      Dim oTask As Task
       
      For Each oTask In ActiveProject.Tasks  'foreach task with ISTCost <> 0
        If ((oTask Is Nothing) = 0) Then  'oTask not null
          If (GetISTCost(oTask) > 1) Then 'IST COST > 1Fr
            If (oTask.Assignments.Count <> 0) Then 'oTask has assignment
              If InStr(1, UCase(oTask.Assignments(1).resourceName), "_COST", vbTextCompare) <> 0 Then 'assignment start with _COST
                If CalculateCostDelta(oTask) > 1 Then 'if (ISTCost - Actual Cost)>1 Fr.
                  SetActualCostDeltaToToday oTask
                      
                      
                  'Update Timephase Actual Cost
                End If
              End If
            End If
          End If
        End If
      Next
      
      'Update Eproc field?
      
      'Publish
      'FileSave
      'Close Project File
    End Sub
    
    Function GetISTCost(ActualTask As Task)
      GetISTCost = ActualTask.GetField(FieldNameToFieldConstant("IST_Cost"))
    End Function
    Function CalculateCostDelta(ActualTask As Task)
      CalculateCostDelta = GetISTCost(ActualTask) - ActualTask.Assignments(1).ActualCost
    End Function
    
    Sub SetActualCostDeltaToToday(ActualTask As Task)
      'MsgBox Date
      Dim beginDate As String
      Dim endDate As String
      Dim offset As Integer
        
      offset = 0
      beginDate = (Date + offset) & " 00:00"
      endDate = (Date + 1 + offset) & " 00:00"
      
      'if actual task not exists for totday
      If 1 = 1 Then 'ActualTask.Assignments(1).TimeScaleData(StartDate:=beginDate, endDate:=endDate, Type:=28, TimeScaleUnit:=4, Count:=1).Item(1).Value = 0 Then
        ActualTask.Assignments(1).TimeScaleData(StartDate:=beginDate, endDate:=endDate, Type:=28, TimeScaleUnit:=4, Count:=1).Item(1).Value = CalculateCostDelta(ActualTask)
      End If
      
      'ActiveProject.Resources.UniqueID(1).Assignments.UniqueID(2097153).TimeScaleData(StartDate:="13.09.10 00:00", EndDate:="14.09.10 00:00", Type:=28, TimeScaleUnit:=4, Count:=1).Item(1).Value = "10000"
      'ActualTask.ActualCost = 500
    End Sub
    

    For sure there is some bug in the code :-) (and I didn't catched exception at the moment.), but it work for me.

    The idea is that there is a custom field called "IST_COST" (numeric CF on TASK) which is filled by PSI first, and then later, the VBA code copy the "IST_COST" field in the standard Actual Cost from the 1st ressource.

    I hope it will help you!

    regards,

    Jean-Yves

    Monday, September 6, 2010 1:22 PM
  •  

    Jean-Yves:

    Thank you so much. 

    kkmick

     

    Wednesday, September 8, 2010 6:41 AM
  • Jean-Yves:

    I am having problem to update cost in psi for the custom field.  I keep on getting CustomFieldErrorAlreadyExists.  Did you run into this problem? When you are trying to update the custom field.  I am able to insert the cost in the custom field for the first time.  But when I tried to run the code the next time.  I will get the error CustomFieldErrorAlready Exists.  I tried to remove the record before inserting.  It did not remove it.  It is still there.   Any idea will be appreciated. 

    Thanks,

    kkmick

     

     

    Monday, September 27, 2010 8:54 PM