NetTalk Central

Author Topic: Best Practiceadvice wanted on priming lookup fields in a form  (Read 3815 times)

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Best Practiceadvice wanted on priming lookup fields in a form
« on: September 05, 2015, 11:44:09 PM »
In standard Clarion applications related parent and Grandparent tables would be setup in the Schematic. I don't need to do any lookups since they are handled by this relationship setup and I can display the original values on the screen
In a Nettalk Form they aren't.
I have a Table which has certain fields related to other parent tables and those parent tables have in their turn related parent tables.
If I want to just display some of the parent/grandparent values in my form what I currently do is create a set of local values and in the PreUpdate embed point I open the various parent tables and read the values and store them to the local variables and then display those variables.

Is this the best way to do this?
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

MyBrainIsFull

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: Best Practiceadvice wanted on priming lookup fields in a form
« Reply #1 on: September 06, 2015, 05:27:10 PM »
Hi Terry, if I need to pull some data table into context so I can display something, I dont use local variables, just the file record itself,
Eg.
        access:SomeFile.Fetch(key)
        p_web.FileToSessionQueue( SomeFile )
               
Then on your form if you want to show the SomeFiles's Description you use
 p_web.GSV('SF:Description')

In this way the whole record is there in the session queue, so if you want to call another proc to do a calc or something, the record is still in context on the session queue there.

You can of course just set a single field, like
       p_web.SSV('SF:Description', SF:Description)

So you dont need local variables, and your parent record is passed to your proc when you send it p_web

Hope this helps
K

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Best Practiceadvice wanted on priming lookup fields in a form
« Reply #2 on: September 06, 2015, 09:24:26 PM »
Hi kevin
In this situation I only want the user to change one setting (the status) All the other fields are displayed.
But I take your point.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186