NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: terryd on September 05, 2015, 11:44:09 PM

Title: Best Practiceadvice wanted on priming lookup fields in a form
Post by: terryd 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?
Title: Re: Best Practiceadvice wanted on priming lookup fields in a form
Post by: MyBrainIsFull 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
Title: Re: Best Practiceadvice wanted on priming lookup fields in a form
Post by: terryd 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.