NetTalk Central

Author Topic: Browse record incomplete until clicked  (Read 3511 times)

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Browse record incomplete until clicked
« on: February 16, 2015, 06:15:16 PM »
I have a form that has a tab with Browse A on it.  Next to the browse is a button that calls Browse B.  Browse B has a form that is primed with a session variable from Browse A (Study_ID). 

When I first open Browse A, I don't manually select a record, I assume the buffer contains the fields in the first record, which is already selected.  If I then call browse B and do an Insert, the Study_ID field is not primed (it is blank).  I find I must explicitly select the first record in Browse A before calling Browse B.

Is there a way to force the first record of Browse A to fill the record buffer, that is to mimic the selection of the first record?

This is C9.1 with NT 8.23

Thanks,

Jeff

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Browse record incomplete until clicked
« Reply #1 on: February 17, 2015, 03:18:31 AM »
>> I assume the buffer contains the fields in the first record, which is already selected.

no, only the SessionValue of the Browse A ID field is set. If you want the rest of the record you need to load it (and do a p_web.FileToSessionQueue )

>>  I find I must explicitly select the first record in Browse A before calling Browse B.

If you are already using the session value of the ID, and the field is still blank, please let me know.

cheers
Bruce

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: Browse record incomplete until clicked
« Reply #2 on: February 17, 2015, 06:48:13 AM »
Bruce,

I think the code I need is the following:

 p_web._LoadRecord(PatientEnrollment, Enr:PatID_key)
 p_web.FileToSessionQueue(PatientEnrollment)

Pat_ID is the primary key but the Study_ID variable is the one I need for the priming operation, and it is part of the record.

I can't seem to find the correct embed to use for this code.  Can you suggest one?

Jeff

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: Browse record incomplete until clicked
« Reply #3 on: February 17, 2015, 09:53:55 AM »
Bruce,

     I think I'm getting this resolved.  In the Browse Procedure, Start of Procedure embed I have the following:

Enr:Patient_ID = p_web.GSV('Enr:Patient_ID')   !this is the session value of the highlighted record
Access:PatientEnrollment.Fetch(Enr:PatID_key)
p_web._LoadRecord(PatientEnrollment, Enr:PatID_key)
p_web.FileToSessionQueue(PatientEnrollment)

Now, when I call Browse B and open the form, the Study_ID is primed properly.  I'm not sure if this is the best embed so I'm open to other suggestions.

     This app is currently being tested by three or four people today.  Another user discovered a similar issue.  They open a browse with 10 records showing, of a total of 100.  They click on record 3 and go to the second browse/form and enter data.  Upon returning to the first browse, they click on Next to go to another page and see the top record highlighted.  If they now go to the second browse/form to enter more data, they find they are entering data for the previous record.  The buffer still contains data for the previous record, until they manually click on a record.  I'm hoping this scenario will also be fixed with my code above.

I'll follow up as I progress.

Thanks,

Jeff

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Browse record incomplete until clicked
« Reply #4 on: February 18, 2015, 03:20:38 AM »
GenerateBrowse routine would be better than Start Of Prcedure. Start of Procedure gets called for every single browse Event, so it'll get called a LOT

cheers
Bruce