C
Claudio Hidetoshi
Hi all.
I'm changing the sample code "ProjTool" (it comes with PJ2007 SDK) to create
new projects. But the global template requires that I set value to a custom
field, named "Docs"(number field). So, I coded:
ProjectWebSvc.ProjectDataSet.ProjectRow projectRow =
dataset.Project.NewProjectRow();
projectRow.PROJ_UID = projGuid;
projectRow.PROJ_NAME = projectName;
if (txtCalendarUid.Text.ToString() != "" )
{
projectRow.CAL_UID = new Guid(txtCalendarUid.Text.ToString());
}
projectRow.PROJ_TYPE = getProjectType();
dataset.Project.AddProjectRow(projectRow);
//the above code is original from the sdk
//my custom code
ProjectWebSvc.ProjectDataSet.ProjectCustomFieldsRow custom =
dataset.ProjectCustomFields.NewProjectCustomFieldsRow();
custom.CUSTOM_FIELD_UID = Guid.NewGuid();
custom.NUM_VALUE = (decimal)1;
custom.MD_PROP_ID = 188744704;
custom.PROJ_UID = projGuid;
dataset.ProjectCustomFields.AddProjectCustomFieldsRow(custom);
When I call project.QueueCreateProject an error apears:
"<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<errinfo>\r\n <dataset
name=\"ProjectDataSet\">\r\n <table name=\"ProjectCustomFields\">\r\n
<row CUSTOM_FIELD_UID=\"161b089c-f4fd-435a-8dbe-eb2b1f456b93\">\r\n
<error id=\"11704\" name=\"CustomFieldInvalidTypeColumnFilledIn\"
uid=\"6fd994bf-9d7b-4861-a6d7-41cc29d2111b\" />\r\n <error
id=\"11713\" name=\"CustomFieldRequiredValueNotProvided\"
uid=\"99584033-8f42-4c19-af07-e241e65951f3\" mdpropuid=\"\" />\r\n
</row>\r\n </table>\r\n </dataset>\r\n</errinfo>"
I don't know what is wrong.
Any help will be very appreciated.
Claudio Hidetoshi.
Rio de Janeiro - Brazil
I'm changing the sample code "ProjTool" (it comes with PJ2007 SDK) to create
new projects. But the global template requires that I set value to a custom
field, named "Docs"(number field). So, I coded:
ProjectWebSvc.ProjectDataSet.ProjectRow projectRow =
dataset.Project.NewProjectRow();
projectRow.PROJ_UID = projGuid;
projectRow.PROJ_NAME = projectName;
if (txtCalendarUid.Text.ToString() != "" )
{
projectRow.CAL_UID = new Guid(txtCalendarUid.Text.ToString());
}
projectRow.PROJ_TYPE = getProjectType();
dataset.Project.AddProjectRow(projectRow);
//the above code is original from the sdk
//my custom code
ProjectWebSvc.ProjectDataSet.ProjectCustomFieldsRow custom =
dataset.ProjectCustomFields.NewProjectCustomFieldsRow();
custom.CUSTOM_FIELD_UID = Guid.NewGuid();
custom.NUM_VALUE = (decimal)1;
custom.MD_PROP_ID = 188744704;
custom.PROJ_UID = projGuid;
dataset.ProjectCustomFields.AddProjectCustomFieldsRow(custom);
When I call project.QueueCreateProject an error apears:
"<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<errinfo>\r\n <dataset
name=\"ProjectDataSet\">\r\n <table name=\"ProjectCustomFields\">\r\n
<row CUSTOM_FIELD_UID=\"161b089c-f4fd-435a-8dbe-eb2b1f456b93\">\r\n
<error id=\"11704\" name=\"CustomFieldInvalidTypeColumnFilledIn\"
uid=\"6fd994bf-9d7b-4861-a6d7-41cc29d2111b\" />\r\n <error
id=\"11713\" name=\"CustomFieldRequiredValueNotProvided\"
uid=\"99584033-8f42-4c19-af07-e241e65951f3\" mdpropuid=\"\" />\r\n
</row>\r\n </table>\r\n </dataset>\r\n</errinfo>"
I don't know what is wrong.
Any help will be very appreciated.
Claudio Hidetoshi.
Rio de Janeiro - Brazil