NetTalk Central

Author Topic: Losing Parent Browse Record SysID  (Read 3490 times)

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Losing Parent Browse Record SysID
« on: December 13, 2013, 05:21:49 PM »
NT 7.31

I have a Form with a Parent Browse and a Child Browse on it.  The parent browse is set up for EIP, and the user clicks on a certain field to enter a value.  Then, they click the Insert button for the Child Browse to enter detailed info associated with that value.  As they complete entering a Child record, we needed for the parent browse to be refreshed so that its conditional CSS to color the row depending on data in the Child records would take effect.  Bruce, you provided the following code some time ago to allow the refreshing of the parent browse.

The following code is placed in the Child form's Post Insert/Change/Delete embed:

  p_web.setValue('_ParentProc_','EnterEnvelopeContributions')
  p_web.DeleteValue('_EIPClm_')
  ListEnvContributions(p_web)

Where EnterEnvelopeContributions is the Form that contains the parent and child browse, and ListEnvContributions is the Parent browse.

This approach worked well, until I upgraded to 7.31.  Now, after the Child record insert, the parent row does correctly get recolored, but the parent row record id is zeroed out.  So, subsequent Child inserts lose its connection to the correct parent record.  Also, if you click on another row in the parent browse, the record id is always zero.  You have to exit the page and reenter it in order for the row id to be correct.  In other words, p_web.GetValue('CTB:SysID') is always zero after the code above is executed.

If we could solve the parent's sysid value from being reset by the code above, then everything would be working great!

Mike Springer

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Re: Losing Parent Browse Record SysID
« Reply #1 on: December 15, 2013, 03:18:46 AM »
Update:
I have started a standalone example to probe further into this.  I have a simple Form with a parent browse and a child browse.  In the parent browse embed for the row being clicked, I added this code:

     message('CTB:SysID= ' & p_web.GSV('CTB:SysID'))

CTB:SysID is the unique key field for the Parent file.  This is the only embed code in the project.

When I click on a row in the parent browse, this message shows the SysID field (the unique key).

However, if I then insert a record into the Child browse, and click on a row in the parent, the message shows no SysID value, regardless of what parent browse row I click on.  If I reload the page, then the sysID shows again for any row clicked in the parent.

Why is the Session Value for the parent sysid field being lost after inserting in a child, and why does clicking on a row after that not provide the sysid in the session value?
Mike

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Re: Losing Parent Browse Record SysID
« Reply #2 on: December 15, 2013, 02:05:19 PM »
One more detail.

In the small example I created, in the template "of 'rowclicked' " code, a call to the "CallClicked" routine is made.  If you click on a parent row, the value of p_web.GSV('CTB:SysID') before the CallClicked routine shows the previously clicked row's CTB:SysID.  After the return from the CallClicked routine, the p_web.GSV('CTB:SysID') shows the newly selected row SysID.  That's as you would expect.

Also, if you click the Change button on the Child Browse and make changes to the child record, and then click on a parent row, the p_web.GSV('CTB:SysID') after the return from the CallClicked routine reflects the correct SysID values.  Good.

However, if you insert a child record, and then click on a new parent row, the p_web.GSV('CTB:SysID') is blanked after returning from the CallClicked routine.  And, any clicks to any parent row results in a blank value.

Hope that helps.
Mike

 

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Losing Parent Browse Record SysID
« Reply #3 on: December 15, 2013, 05:47:49 PM »
Hi Mike, I think I remember reading a NG post some time ago where the following code

p_web.setValue('_ParentProc_','EnterEnvelopeContributions')
  p_web.DeleteValue('_EIPClm_')
  ListEnvContributions(p_web)

was replaced with a refresh on an event. Events were added at some point so you may find some extra info looking back at the Nettalk version updates notes.

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Re: Losing Parent Browse Record SysID
« Reply #4 on: December 16, 2013, 01:42:53 AM »
Thanks Kevin.  Yeah, I found that in the NG, (happened at release 7.15 I believe) and I removed that code along the way of trying to debug the problem.  But, that is not the problem.

In my Update Comments in the posts above, I have created a simple Form with Parent Browse and Child Browse - with no embed code.  Parent browse uses EIP.  If you Insert a record in the child, the parent's SysID (the key field) is cleared, and it remains cleared for any parent row you then click on.  If you change a record in the child, the parent's SysID remains valid and is valid for any parent row you click on.

Mike