I have a fairly simple web application. It has a Console Dialog web component that has three buttons on it. One of the buttons <Order Search> is designed to show all active orders BUT only for the current year and current week and it works fine as long as you don�t close this grid and press the button a second time? If you do that it returns all Orders in the database.
I have a Javascript Function of �{grid.Object}.gridFilterSet('Year = Year(CurrentDate())and Week = Week(CurrentDate())');�
I have the Grid Property to �Show the query statement� turned on.
The first time you activate the grid the SQL statement is:
�SELECT FIRST 6 OrderId, CustomerName, TimePrintedInBack, TimeRequested, TimeCompleted, OrderType, DeliveryType, TotalPrice, Year, Week FROM dbo.OrderHeader WHERE Year = Year( CurrentDate() ) AND Week = Week( CurrentDate() )�. AND it works perfect.
The second time (after closing grid) the SQL statement is:
�SELECT FIRST 6 OrderId, CustomerName, TimePrintedInBack, TimeRequested, TimeCompleted, OrderType, DeliveryType, TotalPrice, Year, Week FROM OrderHeader�.
It is losing the WHERE and I can�t figure out why. Any ideas? Is the Javascript function only called the first time you open the grid even if the Grid is closed and reopened?? Is there some way to call it each time? Is there a way to force the browser to refresh when the button is pushed?
I have also figured out that if I �refresh� the browser manually it again works fine until I close the grid and reopen without manually refreshing the browser.
Very confused, any help is much appreciated.
I have a Javascript Function of �{grid.Object}.gridFilterSet('Year = Year(CurrentDate())and Week = Week(CurrentDate())');�
I have the Grid Property to �Show the query statement� turned on.
The first time you activate the grid the SQL statement is:
�SELECT FIRST 6 OrderId, CustomerName, TimePrintedInBack, TimeRequested, TimeCompleted, OrderType, DeliveryType, TotalPrice, Year, Week FROM dbo.OrderHeader WHERE Year = Year( CurrentDate() ) AND Week = Week( CurrentDate() )�. AND it works perfect.
The second time (after closing grid) the SQL statement is:
�SELECT FIRST 6 OrderId, CustomerName, TimePrintedInBack, TimeRequested, TimeCompleted, OrderType, DeliveryType, TotalPrice, Year, Week FROM OrderHeader�.
It is losing the WHERE and I can�t figure out why. Any ideas? Is the Javascript function only called the first time you open the grid even if the Grid is closed and reopened?? Is there some way to call it each time? Is there a way to force the browser to refresh when the button is pushed?
I have also figured out that if I �refresh� the browser manually it again works fine until I close the grid and reopen without manually refreshing the browser.
Very confused, any help is much appreciated.