MS Project Server 2013 - Project client - Configure bar styles in Gantt-Chart based on enterprise custom field RRS feed

  • Question

  • Dear Forum,

    i have a question concerning the "Show For ... Tasks" condition in MS Project client Gantt Chart Bar Style configuration. How can i reference an enterprise task custom field (e.g. flag field "Set_Bar_To_Grey") in the bar styles? I'm looking for an approach that can be used in all projects stored on the Server, this means that i want to store one view in my enterprise global, that displays the bars in the chart according to task specific value of my enterprise task field. Directly referencing the field in the bar styles setting is not possible. What other options do you see?

    Thanks for your support and kind regards

    Wednesday, March 23, 2016 6:28 PM


  • Hi,

    sorry, it is not possible to use Enterprise Custom Fields of type flag to define Gantt Bar styles. You can only use local fields.

    So you need to define a local flag field in each of your projects with formula [YourECF]. Afterwards, you can use this local field in a view in Enterprise global for defining your bar style.

    If there are too many existing projects, you could use a macro in Enterprise Global (place into "This Project" in Enterprise Global), to set formula for local custom field on open of Enterprise projects.

    Private Sub Project_Open(ByVal pj As Project)
    On Error Resume Next
    If Not pj Is Nothing Then
        If pj.Type = pjProjectTypeEnterpriseCheckedOut _
             Or pj.Type = pjProjectTypeEnterpriseReadOnly Then
    ' Formula to get ECF value in local field
    If CustomFieldGetFormula(pjCustomTaskFlag1) <> "[YourECF]" Then
        CustomFieldSetFormula FieldID:=pjCustomTaskFlag1, Formula:="[YourECF]"
        CustomFieldPropertiesEx FieldID:=pjCustomTaskFlag1, Attribute:=pjFieldAttributeFormula, SummaryCalc:=pjCalcFormula, SummaryCalc:=pjCalcFormula
    End If
    ' Rename flag field to indicate usage
    If CustomFieldGetName(pjCustomTaskFlag1) <> "FlagFromYourECF" Then CustomFieldRename FieldID:=pjCustomTaskFlag1, NewName:="FlagFromYourECF"
        End If
    End If
    End Sub

    Does that help?

    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, March 24, 2016 5:26 AM