NetTalk Central

Author Topic: Session Values from Browse to Form  (Read 3752 times)

rupertvz

  • Sr. Member
  • ****
  • Posts: 326
    • View Profile
    • Email
Session Values from Browse to Form
« on: May 16, 2016, 02:30:45 PM »
Hi Guys,

What is the best way to set more session variables in a browse (for the selected record) to access the values in the form?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Session Values from Browse to Form
« Reply #1 on: May 17, 2016, 11:14:40 PM »
the best way to set session values is to use the
p_web.SetSessionValue method.

I suspect you knew that though, and are asking some other question, but I'm not sure what it is, so perhaps you want to re-phrase...?

Incidentally, if you have in-row buttons (change / delete) then there's no such thing as the "currently selected record" - you are just editing the row which has been "assigned" to that button.
If you need more values then ideally you should load them as necessary when in the form.  (PreUpdate routine)

cheers
Bruce

rupertvz

  • Sr. Member
  • ****
  • Posts: 326
    • View Profile
    • Email
Re: Session Values from Browse to Form
« Reply #2 on: May 18, 2016, 12:23:51 AM »
Thanks Bruce,

I have two browses.
The second browse (child records) has a range limit for selected (parent) record in the first browse.

I need some values from the first browse (parent) to use in the form (updating browse 2).

A session value is available for the range limit from browse 1, how can I add more session values from browse 1?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Session Values from Browse to Form
« Reply #3 on: May 22, 2016, 10:33:03 PM »
The ID of the selected record in Browse 1 is in the SessionValue.
So if you need other fields associated with that ID in Form 2, then in Form 2 load that record from Table 1.

eg

Table1.Id = p_web.GSV('tab1:id')
Access:Table1.Fetch(Tab1:KeyID)
p_web.SetSessionValue('some form field',tab1:LastDate)

Cheers
Bruce