Query dialog field values

Hi all,

i have a requirement as follows.

For example i have three fields to be shown in query dialog box named as Site , Warehouse and Location.

By default everytime the dialog opens it should set the value of site field to 1 and for remaining two fields it should display the last value entered by user i.e. the functionality of pack() and unpack() methods.