|
|
|
date: Thu, 4 Sep 2008 07:48:05 -0700,
group: microsoft.public.project.developer
back
RE: Custom Fields for the Assignment Entity Type
Martin,
I wanted to give you a belated thanks for taking the time to help me out w/
this. I was finally able to find the time to write a test of your specs, and
it worked like a charm.
For those interested, here's what my working code looks like:
public ProjectDataSet.AssignmentCustomFieldsRow
CreateAssignmentCustomFieldsRow(
ProjectDataSet prjDs,
Guid assnGuid,
Guid cfMdProp2ndGuidStr,
int cfMdProp2ndIdStr)
{
ProjectDataSet.AssignmentCustomFieldsRow assnCfRow = null;
if (prjDs != null) {
assnCfRow = prjDs.AssignmentCustomFields.NewAssignmentCustomFieldsRow();
Guid cfAssnRow = Guid.NewGuid();
assnCfRow.CUSTOM_FIELD_UID = cfAssnRow;
assnCfRow.ASSN_UID = assnGuid;
assnCfRow.MD_PROP_UID = cfMdProp2ndGuid;
assnCfRow.MD_PROP_ID = cfMdProp2ndIdStr;
assnCfRow.PROJ_UID = prjGuid;
}
return assnCfRow;
}
public Guid AddResourceAssignmentCustomField(
ProjectDataSet prjDs,
Guid assnGuid,
Guid cfMdProp2ndGuid,
int cfMdProp2ndId,
string value)
{
Guid rv = Guid.Empty();
ProjectDataSet.AssignmentCustomFieldsRow assnCfRow =
CreateAssignmentCustomFieldsRow(prjDs, assnGuid, cfMdProp2ndGuid,
cfMdProp2ndId);
if (null != assnCfRow) {
assnCfRow.TEXT_VALUE = value;
assnCfRow.FIELD_TYPE_ENUM = (int)PSLib.CustomField.Type.TEXT;
prjDs.AssignmentCustomFields.AddAssignmentCustomFieldsRow(assnCfRow);
rv = assnCfRow;
}
return rv;
}
Cheers, Albert
date: Thu, 23 Oct 2008 08:57:01 -0700
author: albupp
|
|