Active Query Builder support area

MetaDataFilterItem - Can this filter fields? E.g I have a table [User] with a field [password] which I wish to hide.

Avatar
  • updated
  • Completed

I have tried the following in C# 

MetadataFilterItem metaFilter;
metaFilter = qbQuery.MetadataLoadingOptions.MetadataFilter.Add();
metaFilter.Exclude = true;
metaFilter.ObjectTypes = MetadataType.Field;
metaFilter.Object = "Password";
metaFilter.CaseSensitive = false;

However I still see the field in the object right pane and designer.

Avatar
Andrey Zavyalov, PM
Hello,

Please replace your code with the following:

MetadataFilterItem metaFilter;
metaFilter = qbQuery.MetadataLoadingOptions.MetadataFilter.Add();
metaFilter.Exclude = true;
metaFilter.Object = "User";
metaFilter.Field = "Password";

metaFilter.CaseSensitive = false;
Avatar
Andrey Zavyalov, PM
If you want to hide the "Password" field from all tables, comment out the "metaFilter.Object = ..." line. The metaFilter.ObjectTypes property works for database objects (Tables, Views, Procedures, Synonyms).
Avatar
Acusoft Software
Thank you, that works a treat.