Trying a search restriction

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
jack2lombre
User
Posts: 7

Trying a search restriction

Post by jack2lombre »

Hello.

I'm trying to limit the search lists on lookup table with only the values that are in use in detail table.

For sample i have a "detail order" table with a "product id" and a lookup on a "product" base table and possible ID values "1","2","3","4","5" .. but in my "detail orders" I currently only have 2 records, with "product id" "1" and "3".

So I'm trying to limit the search values by adding a filter on Lookup_Selecting event, but just on quick and Ext. search.

For this I need to identify on which part of the "List Page" screen I am to limit the Filter modification.
I already know on which page I am with ew_CurrentPage() or CurrentPageId() but I don't know how to recognize if I am on the Search Panel or List Panel. Is it possible ?

Regards.


jack2lombre
User
Posts: 7

Post by jack2lombre »

Ok found something

Event Recordset_Selecting performs just before the quick and ext. search panel
And just after there is the Page_DataRendering event

Code added : Server Event Global Page_Loading
public static Boolean IsFilterLookup { get; set; }

public void Recordset_Selecting(ref string filter)
if ( CurrentPageID() == "list" )
{
IsFilterLookup = true;
}
}

public void Page_DataRendering(ref string header) {
// Example:
// header = "your header";
if (CurrentPageID() == "list")
{
IsFilterLookup = false;
}
}

public void Lookup_Selecting(cField fld, ref string filter) {
// Enter your code here
if (CurrentPageID() == "list")
{
if (IsFilterLookup)
{
*** my code ***
}
}
}


Post Reply