For anyone that may wonder how to do this I was able to solve my problem by doing the following and just repeating this section to various fields I need to update:
{
bool customFieldFound = false;
foreach (ProjectDataSet.ProjectCustomFieldsRow cfRow in myProject.ProjectCustomFields)
{
if (cfRow.MD_PROP_UID == cfIdPmID)
{
cfRow.TEXT_VALUE = cfValuePmID;
customFieldFound = true;
}
}
if (!customFieldFound)
{
ProjectDataSet.ProjectCustomFieldsRow cfRowPmID =
myProject.ProjectCustomFields.NewProjectCustomFieldsRow();
cfRowPmID.SetDATE_VALUENull();
cfRowPmID.SetTEXT_VALUENull();
cfRowPmID.MD_PROP_UID = cfIdPmID;
cfRowPmID.CUSTOM_FIELD_UID = Guid.NewGuid();
cfRowPmID.PROJ_UID = myProjectUid;
cfRowPmID.FIELD_TYPE_ENUM = 21;
cfRowPmID.TEXT_VALUE = Convert.ToString(cfValuePmID);
myProject.ProjectCustomFields.AddProjectCustomFieldsRow(cfRowPmID);
}
}
I moved the
'bool customFieldFound = false;'
to inside each update/create logic above the
'foreach (ProjectDataSet.ProjectCustomFieldsRow cfRow in myProject.ProjectCustomFields)'