C
ctd
Hi,
I tried to display a dropdown list of a custom field values, but kept having
zero record return. Checked the database and see my custom field in the
custom field table with its values in the lookup table. Not sure what I was
missing in the code. 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);
}
}
}
Thanks,
ctd
I tried to display a dropdown list of a custom field values, but kept having
zero record return. Checked the database and see my custom field in the
custom field table with its values in the lookup table. Not sure what I was
missing in the code. 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);
}
}
}
Thanks,
ctd