Custom Dialog Form

I am trying to create a custom dialog.
I know how to create a basic dialog via code using dialog.addfield etc.(…/aa877843.aspx))

But I am wondering how can I create a dialog based on the filter, for example lets say I want to display all the periods from ProjPeriodLine table based on the specific period type(I can hardcode the period type, so lookup should display all periods of the period type “XX”).

I think it is possible to create a custom lookup using a FormDialog but not sure how to do it a in a simple dialog? I don’t want extra overhead by using the FormDialog as the only purpose it will solve would be the ability to give a custom lookup.

Any suggestions on how to get the custom lookup created in a simple dialog(not form dialog) ?

Any idea folks?