Answered by:
Project 2010 Lookup tables, enterprise custom fields

Question
-
I am using Project 2010. I created one lookup table field with some values. I created a text field based on the lookup table. The text field will be appear in each task (task level text custom field).
And I am created application using Project SDK 2010, in which I read fields of all project tasks (Project.ReadProjectEntities method with ProjectEntityType = 2), than I read simple text enterprise custom fields (Project.ReadProjectEntities method with ProjectEntityType = 64). All is ok. But this data don't contains lookup table custom fields. How can I read it?Wednesday, July 13, 2011 12:49 PM
Answers
-
Hello There,
You will need to use the following:
use CustomFieldsWS.CustomFieldDataSet.CustomFieldsRow cfRow to loop through the data:
Mapping: In CfRow
MD_PROP_UID as the CFuid
MD_LOOKUP_TABLE_UID as the Lookup table Uid
MD_PROP_DEFAULT_VALUE as Default value from LTlook at the example to better understand the relationship of CF & LT.
http://msdn.microsoft.com/en-us/library/gg176849.aspxHope that helps.
Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82- Proposed as answer by Amit Khare - Project Management Consultant Thursday, July 14, 2011 9:04 AM
- Marked as answer by guy222 Thursday, July 14, 2011 9:14 AM
- Unmarked as answer by guy222 Friday, July 15, 2011 5:16 AM
- Marked as answer by guy222 Friday, July 15, 2011 9:57 AM
Thursday, July 14, 2011 7:40 AM
All replies
-
you need to use the readlookup table web service to read the lookup table values. go through this msdn article to see the current syntax: http://msdn.microsoft.com/en-us/library/websvclookuptable.lookuptable.readlookuptables
hope this helps.
| Khurram Jamshed | Follow my blog about Enterprise Project Management Solution | http://khurramjamshed.blogspot.com |- Proposed as answer by Amit Khare - Project Management Consultant Thursday, July 14, 2011 9:05 AM
Wednesday, July 13, 2011 12:55 PM -
Thanks. I got lookup tables data, but I can't find relationship between custom fields entries and lookup table data. I try to find coincidence by guid, but there's no result.Thursday, July 14, 2011 6:57 AM
-
Hello There,
You will need to use the following:
use CustomFieldsWS.CustomFieldDataSet.CustomFieldsRow cfRow to loop through the data:
Mapping: In CfRow
MD_PROP_UID as the CFuid
MD_LOOKUP_TABLE_UID as the Lookup table Uid
MD_PROP_DEFAULT_VALUE as Default value from LTlook at the example to better understand the relationship of CF & LT.
http://msdn.microsoft.com/en-us/library/gg176849.aspxHope that helps.
Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82- Proposed as answer by Amit Khare - Project Management Consultant Thursday, July 14, 2011 9:04 AM
- Marked as answer by guy222 Thursday, July 14, 2011 9:14 AM
- Unmarked as answer by guy222 Friday, July 15, 2011 5:16 AM
- Marked as answer by guy222 Friday, July 15, 2011 9:57 AM
Thursday, July 14, 2011 7:40 AM -
I did it! Real thanks all!Thursday, July 14, 2011 8:17 AM
-
You are welcome My friend :)
Please mark the reply as answer as it will help others to find easily when they have same kind of question .
Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82Thursday, July 14, 2011 9:02 AM -
My gladness is premature( I got two tables: first is received by webservice Project.asmx method ReadProjectEntities with ProjectEntityType = 64 (it's TaskCustomFields table) and second - webservice CustomFields.asmx method ReadCustomFields2 (it's CustomFields table). There is the column MD_PROP_UID in both of this tables. If custom field is lookup table custom field then guid values coincide in this column in both tables for the same fields (viz. I can find equivalence), but if custom field is just a string then there is no such coincidence (viz. I can't define field name), guids is different.
Friday, July 15, 2011 5:16 AM -
Ok, Lets see the relationship:
- The lookup table GUID (LT_UID) is not the custom field GUID (MD_PROP_UID).
- The GUID of the lookup table value (LT_STRUCT_UID) and the text value (LT_VALUE_TEXT) are in the LookupTableTrees table, not the LookupTables table.
- You can get the GUID of the custom field. That is the MD_PROP_UID property in a ProjectCustomFields row/ TaskCustomFields row
- Get the GUID of the lookup table value, which is the CODE_VALUE property in the ProjectCustomFields row/TaskCustomFields row that contains the correct MD_PROP_UID.
So lets say for a TASKlevelCF (Guid1) associated with LT (Guid2) which has 2 values (value1- Guid3, value 2-Guid4)
MD_PROP_UID = Guid1On a Task 1 (Guid0), if I assign the TASKlevelCF (Guid1) & set the value of the lOOKUP TABLE 's CODE_VALUE as value 2(Guid 4),
On a Task 2 (Guid00), if I assign the TASKlevelCF (Guid1) & set the value of the lOOKUP TABLE 's CODE_VALUE as value 1(Guid 3),
Now you can refer to point 4.MD_PROP_UID will be different on Task 1 & task 2 which represent the CODE_VALUE of a LT.You can loop throgh the lookupTableDs to find the values (example)
SvcLookupTable.LookupTableDataSet lookupTableDs =
lookupTableClient.ReadLookupTables(string.Empty, false, 1033); // 1033-english
string theLookupTableValue;
Guid customFieldValueUid = projectDs.ProjectCustomFields[0].CODE_VALUE;
for (int i = 0; i < lookupTableDs.LookupTableTrees.Count; i++)
{
if (lookupTableDs.LookupTableTrees[i].LT_STRUCT_UID == customFieldValueUid)
{
theLookupTableValue = lookupTableDs.LookupTableTrees[i].LT_VALUE_TEXT;
break;
}
}Does that clarify your question or I made it confusing?
Not sure but It may be helpful:
http://codeguru.pl/Data/Media/18656/PWA_PUBLISHED%20Database%20Diagram.pdf
Thanks, Amit Khare |EPM Consultant| Blog: http://amitkhare82.blogspot.com http://www.linkedin.com/in/amitkhare82Friday, July 15, 2011 6:17 AM -
Now I describe my problem by example.
it's lookup table custom field data from TaskCustomFields table:
TASK_UID: 59f904b3-2641-44f1-ab97-5e8c28e16f68
MD_PROP_UID: fea92528-a159-4f73-98f5-94e13c01d18c 188776466
CODE_VALUE: 9e6d2760-011e-4446-a98d-b3143998394f
I see CustomFields table for field name:
MD_PROP_UID: fea92528-a159-4f73-98f5-94e13c01d18c 188776466
MD_PROP_NAME: WorkType
Now I defined field name by coincidence fields MD_PROP_UID.
Then I see LookupTableTrees table for meaning of CODE_VALUE:
LT_STRUCT_UID: 9e6d2760-011e-4446-a98d-b3143998394f
LT_VALUE_TEXT: FullWork
Now I defined field value by coincidence fields LT_STRUCT_UID.
Success.
And now problem.
It's string custom field data from TaskCustomFields table:
TASK_UID: 3ca9812a-3edf-4696-84ed-098234c82013
MD_PROP_UID: 000039b7-8bbe-4ceb-82c4-fa8c0b400036
TEXT_VALUE: 66-078-PSO-8
I see CustomFields table for field name, but MD_PROP_UID don't coincide (I'm shure THIS TEXT_VALUE of THIS custom field):
MD_PROP_UID: 0f055945-7e5f-4c8a-9d6d-773569ef6980
MD_PROP_NAME: Meaning
I can't define custom field name.
Fail.
Friday, July 15, 2011 7:22 AM -
Problem is resolved) First project (in which problem appeared) was created before admin added custom fields.
Thanks again.
Friday, July 15, 2011 10:01 AM