none
PS2013: See updates from project schedule page on Tasks page but not vice versa RRS feed

  • Question

  • I have created enterprise custom fields (task level) that I allow the user to change in a custom view on the project schedule page.  Those updates seem to work fine but they aren't included in the task history.  So I added the fields to the task page (My Assignments) and allow them to change the field there but then the changes don't show up on the project schedule page...although the changes are in task history.

    From looking at other posts, I figured out first of all that to see the changes from Project schedule to Tasks, I needed to set the "Roll down, unless manually specified" flag.  Everything works fine there.  Then other posts said you have to write a macro to set the tasks that were changed on the Tasks page.

    Questions:

    * Why are the tasks different on these two pages, I don't understand that?

    * How do I write that macro or can I find one somewhere?

    * Is there another way to get this to work, am I missing something?

    Thanks!

    Rich

    Thursday, February 16, 2017 2:39 PM

Answers

  • Hi,

    when you look at project schedule page, you will see values from task level (at least when you apply a task view).

    A user sees and enters values on assignment level in My Assignments view.

    So when you set values initially in a project, this value is rolled down to assignment level, since you enabled "Roll down, unless manually specified". Unfortunately, the other way will not work. Assume, PM sets value to A, there are two resources assigned to this task. As long as they don't change value, they will see the initial "A". Later one, first resource is changing values to B, the other one to C. What would you now expect on task level? Remember, theyy changed the value on assignment level, overwritting the rolled down value from task.

    As long as you can define a clear rule, how to roll up values to task level, I am willing to help with the macro. Just tell your "rule" and the name of your field.

    Regards
    Barbara


    To increase the value of this forum, please mark the replies that helped to solve your issue as answer. If you find answers to questions from other forum participants to be helpful, please mark them as helpful. Your participation will help others to find an appropriate solution faster. Thanks for your support!

    Thursday, February 16, 2017 7:17 PM
    Moderator
  • Hi,

    getting PM and assignee talk to each other is always the best solution :).

    Here a sample.

    Sub RollUp()
    Dim T As Task
    Dim A As Assignment
    Dim P As Project
    Dim AllTheSame As Boolean
    Dim TAValues As String
    Dim TFieldID    As Double
    
    'MyField is my field name.
    'NOTE: Field name may not contain any blanks (' '). Access ECF on assignment level can only be done with A.<FieldName>, so
    'no blanks are allowed.
    
    TFieldID = Application.FieldNameToFieldConstant("MyField", pjTask)
    Set P = ActiveProject
    
    For Each T In P.Tasks
        If Not T Is Nothing Then
            If Not T.Summary Then
                'If there is only one assignment, we can roll up be just replacing value
                If T.Assignments.Count = 1 Then
                    Set A = T.Assignments(1)
                    If T.GetField(TFieldID) <> A.MyField Then
                        T.SetField FieldID:=TFieldID, Value:=A.MyField
                    End If
                ElseIf T.Assignments.Count > 1 Then
                'Here some kind of rule or logic, e.g. the following
                    TAValues = ""      'collect values
                    AllTheSame = True   'check if action required
                    For Each A In T.Assignments
                        If T.GetField(FieldNameToFieldConstant("MyField", pjTask)) <> A.MyField Then
                            AllTheSame = False
                            TAValues = TAValues & A.MyField
                        End If
                    Next A
                    If Not AllTheSame Then
                        T.SetField FieldID:=FieldNameToFieldConstant("MyField", pjTask), Value:=TAValues
                    End If
                End If
            End If
        End If
    Next T
    End Sub
    

    Does that help?
    Barbara


    To increase the value of this forum, please mark the replies that helped to solve your issue as answer. If you find answers to questions from other forum participants to be helpful, please mark them as helpful. Your participation will help others to find an appropriate solution faster. Thanks for your support!

    Thursday, February 16, 2017 8:08 PM
    Moderator

All replies

  • Hi,

    when you look at project schedule page, you will see values from task level (at least when you apply a task view).

    A user sees and enters values on assignment level in My Assignments view.

    So when you set values initially in a project, this value is rolled down to assignment level, since you enabled "Roll down, unless manually specified". Unfortunately, the other way will not work. Assume, PM sets value to A, there are two resources assigned to this task. As long as they don't change value, they will see the initial "A". Later one, first resource is changing values to B, the other one to C. What would you now expect on task level? Remember, theyy changed the value on assignment level, overwritting the rolled down value from task.

    As long as you can define a clear rule, how to roll up values to task level, I am willing to help with the macro. Just tell your "rule" and the name of your field.

    Regards
    Barbara


    To increase the value of this forum, please mark the replies that helped to solve your issue as answer. If you find answers to questions from other forum participants to be helpful, please mark them as helpful. Your participation will help others to find an appropriate solution faster. Thanks for your support!

    Thursday, February 16, 2017 7:17 PM
    Moderator
  • I see, thanks for the explanation!

    I guess last in wins is good enough for me.  I would think for my purposes, the changes are such that the PM and the assignee should agree on the values that they change.

    I would appreciate a simple example.  They are running a macro, then?

    Thursday, February 16, 2017 7:26 PM
  • Hi,

    getting PM and assignee talk to each other is always the best solution :).

    Here a sample.

    Sub RollUp()
    Dim T As Task
    Dim A As Assignment
    Dim P As Project
    Dim AllTheSame As Boolean
    Dim TAValues As String
    Dim TFieldID    As Double
    
    'MyField is my field name.
    'NOTE: Field name may not contain any blanks (' '). Access ECF on assignment level can only be done with A.<FieldName>, so
    'no blanks are allowed.
    
    TFieldID = Application.FieldNameToFieldConstant("MyField", pjTask)
    Set P = ActiveProject
    
    For Each T In P.Tasks
        If Not T Is Nothing Then
            If Not T.Summary Then
                'If there is only one assignment, we can roll up be just replacing value
                If T.Assignments.Count = 1 Then
                    Set A = T.Assignments(1)
                    If T.GetField(TFieldID) <> A.MyField Then
                        T.SetField FieldID:=TFieldID, Value:=A.MyField
                    End If
                ElseIf T.Assignments.Count > 1 Then
                'Here some kind of rule or logic, e.g. the following
                    TAValues = ""      'collect values
                    AllTheSame = True   'check if action required
                    For Each A In T.Assignments
                        If T.GetField(FieldNameToFieldConstant("MyField", pjTask)) <> A.MyField Then
                            AllTheSame = False
                            TAValues = TAValues & A.MyField
                        End If
                    Next A
                    If Not AllTheSame Then
                        T.SetField FieldID:=FieldNameToFieldConstant("MyField", pjTask), Value:=TAValues
                    End If
                End If
            End If
        End If
    Next T
    End Sub
    

    Does that help?
    Barbara


    To increase the value of this forum, please mark the replies that helped to solve your issue as answer. If you find answers to questions from other forum participants to be helpful, please mark them as helpful. Your participation will help others to find an appropriate solution faster. Thanks for your support!

    Thursday, February 16, 2017 8:08 PM
    Moderator