S
SunGard
I cannot find a way in the local project object model to find the type of a
custom field. Using PSI, I can do this as follows:
Dim fieldType As
Microsoft.Office.Project.Server.Library.CustomField.Type = Nothing
Dim cf As Microsoft.Office.Interop.MSProject.PjCustomField = some custom
field
...
dim cfs As New CustomFieldsWebSvc.CustomFields()
dim cfds As New CustomFieldsWebSvc.CustomFieldDataSet()
...
cfs.ReadCustomFieldsByEntity(New Guid(projectEntity))
...
' Get field type
fieldType =
cfds.CustomFields.FindByMD_PROP_UID(cf.MD_PROP_UID).MD_PROP_TYPE_ENUM
How can I do this when not connected to the Project Server?
I also need to get whether the field is required or not (which works with
PSI below):
' Get field "requiredness"
isRequired =
cfds.CustomFields.FindByMD_PROP_UID(cf.MD_PROP_UID).MD_PROP_IS_REQUIRED
MS Project knows this information somehow because "Project Information"
displays the fields with asterisks, etc. in the custom field editor even when
not connected to Project Server. It must be in the "Active Cache" which I
can't seem to get to.
Please help - just this issue is forcing a redesign of the whole code base I
have been working on!
custom field. Using PSI, I can do this as follows:
Dim fieldType As
Microsoft.Office.Project.Server.Library.CustomField.Type = Nothing
Dim cf As Microsoft.Office.Interop.MSProject.PjCustomField = some custom
field
...
dim cfs As New CustomFieldsWebSvc.CustomFields()
dim cfds As New CustomFieldsWebSvc.CustomFieldDataSet()
...
cfs.ReadCustomFieldsByEntity(New Guid(projectEntity))
...
' Get field type
fieldType =
cfds.CustomFields.FindByMD_PROP_UID(cf.MD_PROP_UID).MD_PROP_TYPE_ENUM
How can I do this when not connected to the Project Server?
I also need to get whether the field is required or not (which works with
PSI below):
' Get field "requiredness"
isRequired =
cfds.CustomFields.FindByMD_PROP_UID(cf.MD_PROP_UID).MD_PROP_IS_REQUIRED
MS Project knows this information somehow because "Project Information"
displays the fields with asterisks, etc. in the custom field editor even when
not connected to Project Server. It must be in the "Active Cache" which I
can't seem to get to.
Please help - just this issue is forcing a redesign of the whole code base I
have been working on!