Jump to content

Lookup - one portal to another?


Saubs

This topic is 6113 days old. Please don't post here. Open a new topic instead.

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--

Link to comment
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.

Link to comment
Share on other sites

This topic is 6113 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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