Hi (I have started a new topic on this because the other thread was getting long and I wanted to start again because things have changed and moved on)
I have discovered some very peculiar things after exhaustively investigating this problem. Firstly a recap of the current situation:
I now have a running application which includes 3 separate forms and lookups on a Districts file. Districts has two fields, Country and District. This running application works perfectly as regards these lookups in two cases viz:
- standard browse form
- option where a form is opened in change mode (no browse)
The third case does not work all the time - form opens in insert mode. Specifically what happens here is that I prime country with 'New Zealand'(and this appears correctly as a radio field on the opened form) but after popping up the Districts browse, seeing the correct districts for that country (I have a filter in the browse on current country, if upper(p_web.GSV('FND:Country')) not= upper(Dis:Country) then CYCLE.) and selecting a district, the value does not get displayed in the district field.
Now, if you change country, say to 'Australia', and lookup again, the correct new districts are displayed in the browse and selection causes the receiving field to be properly populated. From then on you can go back to any country and get the right answer. So, its only on the first time access of the loookup for this 'insert mode' case that the procedure fails.
Also, 'Building Applications with NetTalk' says that if the lookup browse is a popup (which mine is) then the only field that you can get back is the primary key field (in my case RecordId) and that a way around that, if you want to actually put the description back into the database field (i.e. non-normalised data) then add an assignment, in this case fnd:address4 = dis:name. However, my testing seems to indicate that this is not necessary. If you specify the Value field as dis:name and do not do the extra assignment then the district name is correctly stored. I would appreciate a comment on that - have things changed since the book was released?
Lastly, a weird thing happens when I change the option for the lookup browse from popup to not. The browse appears as before (but full screen) and after selection, the page is redisplayed but the user is logged out and only the login menu option is available! This is either a bug or I have done something silly but either way I would like to know the answer just as a matter of interest.
My questions then are why does this 'insert mode' case not return the selected data to the field first time, is the 'Book' out of date and what about 'not popup'?
Thanks
Keith