Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
other
informationbridge
office.intranets
office.misc
office.setup
office.xml
officeupdate
onenote
photodraw.discussion
powerpoint
producer
proj.standard&server
project
project.developer
project.pro_and_serve
project.server
project.vba
project2000
publisher
publisher.prepress
publisher.programming
publisher.webdesign
visio
visio.createshapes
visio.database.modeling
visio.dev.diagrams
visio.dev.shapesheet
visio.dev.vba
visio.dev.vc
visio.developer
visio.general
visio.installation
visio.printing
visio.software.modeling
visio.troubleshoot
  
 
date: Thu, 4 Sep 2008 07:48:05 -0700,    group: microsoft.public.project.developer        back       


Custom Fields for the Assignment Entity Type   
Does anyone know what the story is with regards to setting custom fields on 
resource assignments?  It appears that the currently this is not supported.  
Calling ReadCustomFieldsByEntity interface of the Project server's 
CustomFields web service, and passing a "Assignment" as the entity type 
argument results in a CustomFieldInvalidEntityUID error.  Also, the via 
Office Project Web Access' when creating a new enterprise custom field, the 
interface only offers choices for Project, Task and Resource entity types.   
However, looking at the ProjectDataSet defined by the API, one finds that it 
includes a AssignmentCustomFieldsDataTable.  What's the point of this table 
if there's no way create custom fields associated with an assignment entity?

-Albert
date: Thu, 4 Sep 2008 07:48:05 -0700   author:   albupp

RE: Custom Fields for the Assignment Entity Type   
There aren't  special custom field for assignments, (You have to use Task and 
resource custom fields)


You have to know that instead of 
field.MD_PROP_ID
field.MD_PROP_UID

you have to use 

field.MD_PROP_ID_SECONDARY and 
field.MD_PROP_UID_SECONDARY

from your assignment custom property.
-- 
Blog: http://www.projectserver.cz
date: Thu, 4 Sep 2008 12:28:01 -0700   author:   Martin Winzig

RE: Custom Fields for the Assignment Entity Type   
Martin,

Thank you for the response to my question. 

I'm afraid though that I don't understand what you mean.  I can see, now 
that you've pointed it out to me, the MD_PROP_ID_SECONDARY & 
MD_PROP_UID_SECONDARY properties in the CustomFieldDataSet.CustomFieldsRow 
type.  However, I don't understand where I get an assignment custom field 
GUID from.  Is this simply from a CustomFieldsRow instance?  If so, what 
makes it an "assignment custom field"?

I don't suppose that you could post a code snippet that demonstrates setting 
a value in a custom field associated w/ a given assignment?

Thanks again, Albert
date: Thu, 4 Sep 2008 13:45:01 -0700   author:   albupp

RE: Custom Fields for the Assignment Entity Type   
assignment custom field are stored in  table AssignmentCustomFields 
(Projectdataset ) so you should find & update or add new row to this table :)

row.CUSTOM_FIELD_UID = Guid.NewGuid();
  row.MD_PROP_UID = field.MD_PROP_UID_SECONDARY;
 row.MD_PROP_ID = field.MD_PROP_ID_SECONDARY;
......
...


-- 
Blog: http://www.projectserver.cz


"albupp" wrote:

> Martin,
> 
> Thank you for the response to my question. 
> 
> I'm afraid though that I don't understand what you mean.  I can see, now 
> that you've pointed it out to me, the MD_PROP_ID_SECONDARY & 
> MD_PROP_UID_SECONDARY properties in the CustomFieldDataSet.CustomFieldsRow 
> type.  However, I don't understand where I get an assignment custom field 
> GUID from.  Is this simply from a CustomFieldsRow instance?  If so, what 
> makes it an "assignment custom field"?
> 
> I don't suppose that you could post a code snippet that demonstrates setting 
> a value in a custom field associated w/ a given assignment?
> 
> Thanks again, Albert
> 
>
date: Thu, 4 Sep 2008 14:14:01 -0700   author:   Martin Winzig

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

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us