NetTalk Central

Author Topic: Table update Netwebform with popup memory forms  (Read 1512 times)

JohanR

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
    • Email
Table update Netwebform with popup memory forms
« on: August 20, 2025, 11:56:16 PM »

Hi,

I have a table update FORM, the master.

On it I have a few buttons that call small popup forms that also update some of the same table fields, the popup form are memory forms.
These fields are sometimes display fields on the master FORM, sometimes not.

It all seems to work and the table fields from the popups are updated and saved, but still testing the process to make sure all is reliable.

The way I undestand is that the Table update form will write the record from the session variables?

Is there anything to follow to make this process 100% reliable?
eg. call a certain sync routine to ensure all is good?

Is there perhaps a webinar or resource that discusses simialr process that will be of use?


thanks

Johan

rjolda

  • Sr. Member
  • ****
  • Posts: 389
    • View Profile
    • Email
Re: Table update Netwebform with popup memory forms
« Reply #1 on: August 21, 2025, 02:17:44 AM »
Hi Johan,
Maybe this will shed some light on what is going on under the hood.....
Consider this:

!Access:MailBoxes.Open()
!Access:MailBoxes.UseFile()
!MAI:MailBoxNumber = p_web.GSV('MAI:MailBoxNumber')
!Access:MailBoxes.Fetch(MAI:PrimaryKey)
!p_web.FileToSessionQueue(MailBoxes)  <<<<<<<<<<<<======================
!Access:MailBoxes.Close()

This populates the SSV for each field!!!!  This happens at the beginning of the FORM After Files are OPEN..


These ae the working statements:
p_web.FileToSessionQueue(file) copies an entire file record buffer to the session data queue.
p_web.FileToSessionQueue(file, Net:AlsoValueQueue) copies the entire record buffer to both the session data queue, and the value queue at the same time.

So, you manipulate SERVER VALUES of the data through the form.  ( One of the reasons it is done that way is because the "form" is not persistent.  Net Talk goes in and out of the form several times (stages) before it closes - so to keep the data persistent, the field data is stored in SERVER VALUES ( which do persist).  Note: SERVER VALUES for each field are persistent and can be changed elsewhere and be updated such that the NEW VALUE is really the one that gets written to the record when SessionQueueToFile is called.

When ALL IS DONE then the SERVER VALUES containing the field values for the record are written back into the file in one go of it:

p_web.SessionQueueToFile(file) primes a record buffer with contents from the session data queue.

After a little more cleanup, the Form is done and the record has been updated.

As an aside, sometimes I need to update another file.  Rather than do the whole File to Queue and back, I will fetch the record that I want and stuff in the new value and update it.  e.g.
item:ihid = 100
if Access:ITEMS.Fetch(ITM:IHID_KEY) = Level:Benign
   itm:amtinstock = 25
   itm:descrip = p_web.GSV('My item 100')
   Access:ITEMS.Update()
else
  ! some error message
end
THis sequence remains "in scope" as it processes it all together.

Hope this might help a little.
Ron






JohanR

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
    • Email
Re: Table update Netwebform with popup memory forms
« Reply #2 on: August 21, 2025, 02:23:13 AM »
Hi Ron

Thanks, that is a very clear explanation.

You have confirmed what I understand it to do with some more information that is very helpful

thanks

Johan