I'm trying to do something slightly out of the ordinary with a lookup, and I'm getting some strange results. I've spent so much time trying different things now, that I've got myself all confused, so I thought I'd post here to check that I'm not going about it all wrong.
I have a number of forms where the user has to populate a postal address (Addr1, addr2 , town, postal code, etc.). I would like to allow the user to enter certain known bits of the address, and then press a lookup button. I would then like to display a browse with various address lines that match the keyed criteria, that they could select, which would populate on the original form.
I would like to fill my lookup browse manually, using an SQL query or some address lookup software and a temporary table filtered by session ID. The idea being that I can run an sql query to see if they've ever used the address before, in which case use it, or failing that, use the address lookup software to give them some options. Once the lookup has completed, I can clear down the temporary table.
I've sort of got this working, by attaching a lookup button to one of the fields on the form (postcode/zipcode), but after selecting my record from the lookup browse, I get random text appearing in the original form field. I'm also not convinced that I'm managing to pass the key entered data to my lookup correctly for my SQL query. Using Stop messages, my sqlquery seems to be firing at some funny times, without it having any data to use for the where clause.
I've also noticed that the lookup seems to behave differently if I have it as a popup. In popup mode one field in the form gets populated from the lookup. If not in popup mode, all of the other address fields get populated too (Which is what I want).
So my questions are:
1) Do I use a lookup button attached to one of the fields on my form, or should I create a separate button to call my lookup?
2) How do I make sure that all of my address variables on my form are passed to the lookup browse, and how to I get them back again (the FileToSessionQueue doesn't seem to work in this case)
3) Which Embed should I use to call my SQL in the Lookup browse? I've tried "Start of Procedure" and "Call Browse" so far.
Any suggestions would be very welcome.
Regards,
Neil.