I am trying to show a Browse Dialog that is "pre-filtered" to only show records that belong to a specific Customer while allowing the user to then search through that subset. I am trying to use a hidden field to accomplish this.
The code below works as long as the foreign key search field is visible. If visible is set to false the foriegn key field's initial value is ignored and all records are returned.
Me.JobsitesBrowseDialog.SearchFields.Item("js_FK_cu_id").InitialValue = Me.CustomerBO1.cu_pk_id
' Me.JobsitesBrowseDialog.SearchFields.Item("js_FK_cu_id").Visible = False
You can changes the formlayout before you call the ShowDialog. Just move the BrowseResults into the top panel and hide the bottom. This way all you see is the browse results (an possibly an information or side panel...which you can turn off as well).
Me.JobsitesBrowseDialog.FormLayout.TopPanelContents = BrowseDialogLayoutType.BrowseResults
Me.JobsitesBrowseDialog.FormLayout.ShowBottomPanel = False
I was hoping to be able to "pre-load" the dialog with the result set for just that customer and then allow the user the abiltiy to specify additional search criteria such as city etc. to drill down a bit more into the pick list.
If the non visible search fields are not used in the search what would be the reason for having the visible property on a search field? It seems to me that even if a developer wished to simply hide the field for whater reason including the hidden field in the query would not affect the result set unless there was a default value set on it? One of those things I guess
Thanks again
P
We may add a property that allows the developer to determine if the hidden fields should be included on a search. The reason this field exists is so that you can go in and pre-define as many search fields as you would like. You can then write a preference form to allow your end-users to determine which fields they would like to see, and in what order, in their search window. You would then set the fields according to the saved preferences before the form is shown. This is what we do for our end-users because everybody has their own idea of what fields that they want to have to search on...this way we can let them pick and choose while maintaining the integrity of the browse.
Paul