NetTalk Central

Author Topic: Form on Form  (Read 3380 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Form on Form
« on: March 20, 2014, 12:32:17 PM »
Ok, I want to use the new NT8 feature of form on form.
As I read, the form to add must be a memory form
Then here is my problem:

I have a table1 related to anothher (table2) 1:1

The gol is table1 and table2 data data may be ADD and CHANGE at the same time

Then,  I began with a Table Form and in Tab1 I add fields from table1 to edit.

I need the second tab to hold fields from table2, but I only can insert a memory form...

Then how and where do I read an assign fields from the table2 to the memory fields

and how and where do I ADD or CHAGE the table2?

Thanks for any idea
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Form on Form
« Reply #1 on: March 20, 2014, 10:04:57 PM »
If you want to do additional work, on Form 1, when the Save is pressed, then the correct embed is either ValidateInsert etc or PostInsert etc in form 1.

At that point the fields from Form2 are in the Value queue, and can be access via GetValue.

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Form on Form
« Reply #2 on: March 21, 2014, 03:24:50 AM »
No I don want to do any aditional work.
Idont know if you undesrtand me or may be I dont understand form on fomr.

Form on form can be done only if the second form is memory right?
Then I neeed to populate fields that not belongs to any table? or I can populate table fields in a memory field?
If its right and I popoulate the fileds from table2 in form2 they can be edited and get saved when you save the table form?

THanks
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Form on Form
« Reply #3 on: March 24, 2014, 01:20:27 AM »
>> No I don't want to do any additional work.

ha ha - no one does I suppose. My point was is that if you are writing to a second table, then that is additional work, and you should embed the code as I described earlier.

>> Form on form can be done only if the second form is memory right?

correct.

>> Then I neeed to populate fields that not belongs to any table? or I can populate table fields in a memory field?

You can populate table fields on a memory form. But they are just fields, no disk access is done to prime, or same them. You need to do that yourself.

>> If its right and I popoulate the fileds from table2 in form2 they can be edited and get saved when you save the table form?

sure, but you need to do the saving.

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Form on Form
« Reply #4 on: March 24, 2014, 05:05:45 AM »
Fetching is the easy part but...
Updating... how to do it?
Must I add code like:

xxx:myfield1 = p_web.gcv('xxx:myfield1')
xxx:myfield2 = p_web.gcv('xxx:myfield2')
...

for aech one of the fields before update?

or there is a better way?

-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Form on Form
« Reply #5 on: March 24, 2014, 05:09:05 AM »
p_web.SessionQueueToFile(customers)

but these fields may not be in the session queue at this point, they may only be in the Value queue. So test that.

cheers
Bruce