Bruce
Yes FIL:services and the other Name fields are threaded.
There are two bits of WebHandler - ProcessLink code - CodeA is followed immediately by CodeB.
CodeA p_web.StoreValue('b')
if p_web.GSV('b') not= '' !this is an inquiry
relate:clients.OPEN()
Cli:Name = p_web.GSV('b')
Access:Clients.Fetch(Cli:byName)
P_web.SSV('username',Cli:Name)
p_web.SSV('business',Cli:FullName)
p_web.SetSessionLoggedIn(1)
p_web.SetSessionLevel(1)
Relate:Clients.close()
END
As noted, I imagined that this code would only be executed if the beginning URL ended in ?b=<something>. I also thought that if this code got executed again during the session that the Value of 'b' would remain even though the URL was changing. The code sets up the 'username' Session Variable which is used to construct the filenames.
CodeB if p_web.GetSessionLoggedIn() > 0 !user is logged in
Relate:Control.OPEN()
SET(control)
Access:Control.NEXT()
FIL:Customers = CLIP(CON:filePath) & p_web.GSV('username') & '\Customers.tps'
FIL:Bookings = CLIP(CON:filePath) & p_web.GSV('username') & '\Bookings.tps'
FIL:Rooms = CLIP(CON:filePath) & p_web.GSV('username') & '\Rooms.tps'
FIL:Pets = CLIP(CON:filePath) & p_web.GSV('username') & '\Pets.tps'
FIL:Services = CLIP(CON:filePath) & p_web.GSV('username') & '\Services.tps'
FIL:RoomsBooked = CLIP(CON:filePath) & p_web.GSV('username') & '\RoomsBooked.tps'
FIL:BookedServices = CLIP(CON:filePath) & p_web.GSV('username') & '\BookedServices.tps'
FIL:BookedPets = CLIP(CON:filePath) & p_web.GSV('username') & '\BookedPets.tps'
FIL:Quotes = CLIP(CON:filePath) & p_web.GSV('username') & '\Quotes.tps'
END
SessionLoggedIn is set to 1 either in CodeA or in the Login code. Here we are only considering the CodeA case. Note that in the scenario below when CodeB is not executed it indicates that Logged In is 0.
This is what happens:
Execute with URL=http://127.0.0.1:8094?b=bill
WebHandler: CodeA executed - 'username' correctly set, session is logged in.
WebHandler: CodeB executed - Services fully qualified file name correctly set
The correct menu item 'Get a Quote' is displayed.
Click on 'Get a Quote' Menu item
URL still has ?b=bill
WebHandler: CodeA executed - 'username' correctly set, session is logged in.
WebHandler: CodeB executed - Services fully qualified file name correctly set
WebHandler: CodeA executed - 'username' correctly set, session is logged in.
WebHandler: CodeB executed - Services fully qualified file name correctly set
(Yes, this happens twice, (I wouldn't mind understanding why))
URL now changes to
http://127.0.0.1:8094/uQuotesThe Quotes Form is correctly displayed
On the Quotes form the Lookup icon on the Service field is clicked
A blank 'Services' Browse is displayed
WebHandler: CodeA executed - 'username' correctly set, session is logged in.
WebHandler: CodeB executed - Services fully qualified file name correctly set
WebHandler: CodeA is not executed
WebHandler: CodeB is not executed
At the end of CodeB the Services file name is blank
The file error (45) is posted
In my first post I said that the file error occurs after a selection is made on the Services browse. Today I have had one case where that happened but all other cases (about 10) are as described above.
Thanks again for taking the time to look into this