Read custom fields using PSI

  • Follow


Hi,
This is urgent so I hope someone can help.  Thanks.

I tried to display a dropdown list of a custom field's values, but kept 
having 
zero record return.   Checked the database and saw my custom field in the 
custom field table and its values in the lookup table.   Not sure what I was 
missing in the code but no record was returned.  Below is my code in C#:

private CustomFieldWS.CustomFieldDataSet readCustomFieldDS =
                new CustomFieldWS.CustomFieldDataSet();
private LookupTableWS.LookupTableDataSet lookupDS =
                new LookupTableWS.LookupTableDataSet();

private void ReadCustomFields()
        {
            strCustField = "Classification";

            DataView dataview = new DataView(readCustomFieldDS.CustomFields);
            dataview.RowFilter =       
readCustomFieldDS.CustomFields.MD_PROP_NAMEColumn.ColumnName +
                    " = '" + strCustField + "'";
            if (dataview.Count == 0) return;

            CustomFieldWS.CustomFieldDataSet.CustomFieldsRow rowCF =
                    
(CustomFieldWS.CustomFieldDataSet.CustomFieldsRow)dataview[0].Row;

            foreach (LookupTableWS.LookupTableDataSet.LookupTableTreesRow 
row in lookupDS.LookupTableTrees.Rows)
            {
                if (rowCF.MD_LOOKUP_TABLE_UID == row.LT_UID)
                {
                    ddlTitleClass.Items.Add(row.LT_VALUE_TEXT);
                }
            }
        }


0
Reply Utf 3/17/2010 12:00:01 AM

ctd --

I would recommend you repost this question in the 
microsoft.public.project.developer newsgroup and allow our developer friends 
to assist you.  Hope this helps.

-- 
Dale A. Howard [MVP]
VP of Educational Services
msProjectExperts
http://www.msprojectexperts.com
http://www.projectserverexperts.com
"We write the books on Project Server"


"ctd" <ctd@discussions.microsoft.com> wrote in message 
news:56413B22-B913-4D2E-9793-3A33767E3F4C@microsoft.com...
> Hi,
> This is urgent so I hope someone can help.  Thanks.
>
> I tried to display a dropdown list of a custom field's values, but kept
> having
> zero record return.   Checked the database and saw my custom field in the
> custom field table and its values in the lookup table.   Not sure what I 
> was
> missing in the code but no record was returned.  Below is my code in C#:
>
> private CustomFieldWS.CustomFieldDataSet readCustomFieldDS =
>                new CustomFieldWS.CustomFieldDataSet();
> private LookupTableWS.LookupTableDataSet lookupDS =
>                new LookupTableWS.LookupTableDataSet();
>
> private void ReadCustomFields()
>        {
>            strCustField = "Classification";
>
>            DataView dataview = new 
> DataView(readCustomFieldDS.CustomFields);
>            dataview.RowFilter =
> readCustomFieldDS.CustomFields.MD_PROP_NAMEColumn.ColumnName +
>                    " = '" + strCustField + "'";
>            if (dataview.Count == 0) return;
>
>            CustomFieldWS.CustomFieldDataSet.CustomFieldsRow rowCF =
>
> (CustomFieldWS.CustomFieldDataSet.CustomFieldsRow)dataview[0].Row;
>
>            foreach (LookupTableWS.LookupTableDataSet.LookupTableTreesRow
> row in lookupDS.LookupTableTrees.Rows)
>            {
>                if (rowCF.MD_LOOKUP_TABLE_UID == row.LT_UID)
>                {
>                    ddlTitleClass.Items.Add(row.LT_VALUE_TEXT);
>                }
>            }
>        }
>
> 
0
Reply Dale 3/17/2010 1:05:05 AM

See my reply in the Developer NG.

--
Stephen C. Sanderlin, Project MVP
VP of Technology
msProjectExperts
90 John Street, Ste. 404
New York, NY 10038

E: �� stephen.sanderlin@msprojectexperts.com
NYC:� (646) 736-1688 x26
PA: � (215) 538-5373
Cell: (267) 446-4064
Fax:� (973) 556-1191

http://www.msprojectexperts.com

�
Are You Project 2010 Ready?
Work Management Solutions for Individuals, Teams, and the Enterprise



"ctd" <ctd@discussions.microsoft.com> wrote in message 
news:56413B22-B913-4D2E-9793-3A33767E3F4C@microsoft.com:

> Hi,
> This is urgent so I hope someone can help.  Thanks.
>
> I tried to display a dropdown list of a custom field's values, but kept
> having
> zero record return.   Checked the database and saw my custom field in the
> custom field table and its values in the lookup table.   Not sure what I was
> missing in the code but no record was returned.  Below is my code in C#:
>
> private CustomFieldWS.CustomFieldDataSet readCustomFieldDS =
>                 new CustomFieldWS.CustomFieldDataSet();
> private LookupTableWS.LookupTableDataSet lookupDS =
>                 new LookupTableWS.LookupTableDataSet();
>
> private void ReadCustomFields()
>         {
>             strCustField = "Classification";
>
>             DataView dataview = new DataView(readCustomFieldDS.CustomFields);
>             dataview.RowFilter =
> readCustomFieldDS.CustomFields.MD_PROP_NAMEColumn.ColumnName +
>                     " = '" + strCustField + "'";
>             if (dataview.Count == 0) return;
>
>             CustomFieldWS.CustomFieldDataSet.CustomFieldsRow rowCF =
>
> (CustomFieldWS.CustomFieldDataSet.CustomFieldsRow)dataview[0].Row;
>
>             foreach (LookupTableWS.LookupTableDataSet.LookupTableTreesRow
> row in lookupDS.LookupTableTrees.Rows)
>             {
>                 if (rowCF.MD_LOOKUP_TABLE_UID == row.LT_UID)
>                 {
>                     ddlTitleClass.Items.Add(row.LT_VALUE_TEXT);
>                 }
>             }
>         }

0
Reply Stephen 3/17/2010 1:11:10 AM

2 Replies
1764 Views

(page loaded in 0.074 seconds)

Similiar Articles:
















7/20/2012 8:03:10 AM


Reply: