AronGahagan / cpt-dev

Code repository for the ClearPlan Toolbar
https://www.ClearPlanConsulting.com
3 stars 1 forks source link

cptStatusSheet - account for blank ECF names #382

Closed AronGahagan closed 4 months ago

AronGahagan commented 8 months ago

Problem:

The following trips an error if the ECF has a blank custom field name:

200-        ElseIf FieldNameToFieldConstant(rstFields(1), pjTask) >= 188776000 Then '<-- ERROR
201-          .lboFields.List(.lboFields.ListCount - 1, 2) = "Enterprise"
202-        Else

Solution:

Change this:

180-  For lngField = 188776000 To 188778000 '2000 should do it for now
181:    If Application.FieldConstantToFieldName(lngField) <> "<Unavailable>" Then
182:      rstFields.AddNew Array(0, 1, 2), Array(lngField, Application.FieldConstantToFieldName(lngField), "Enterprise")
183-    End If
184-  Next lngField

to this:

180-  For lngField = 188776000 To 188778000 '2000 should do it for now
181:    If Len(FieldConstantToFieldName(lngField))>0 And FieldConstantToFieldName(lngField) <> "<Unavailable>" Then
182:      rstFields.AddNew Array(0, 1, 2), Array(lngField, FieldConstantToFieldName(lngField), "Enterprise")
183-    End If
184-  Next lngField

Todo: