Jump to content
Sign in to follow this  
Saubs

Lookup - one portal to another?

Recommended Posts

I have a script in fileB.fp7 which creates a new record in t_sessions and populates 7 fields using a lookup (from a table in fileA.fp7).

Also on the layout is a portal, which shows related records from t_songs (another table in fileB.fp7).

When the script runs, I also want to use a lookup to populate the portal with data from a portal in fileA.fp7. How can this be done?

Hope that makes sense; Novice developer here.

Many thanks--

Share this post


Link to post
Share on other sites

Seems like you're really just trying to do a data transport. You can do this in a number of ways but the way that it's generally done is thus:

- Make enough data only layouts for all the tables that you're working on. These will be blank as all heck... just fields, generally... no portals.

- Have the script go to data layout 'A' and grab all the data that you want to transport into variables. If there's related data that you need, use 'Go to Related Record' rather than trying to traverse portals.

- Have the script go to data layout 'B' and use setField to populate all the correct data.

This is the basic technique. There *are* ways to use portals for this but I've found this method very speedy and extremely reliable.

Honestly, every time I add a table to the DB, I make two new data layouts. One has the uncalculated/unsummarized data only for the times that I need to just go in and change the data, the other has all the calcs (no summaries) so that I can use that one when I have to. Calcs are expensive so when doing transports, I really only want to grab them when I have to.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.