Jump to content

Append Related Records to Parent Table


dogcows

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

Recommended Posts

Hello everyone. I am relitivley new to developing in FMP and am stuck with a problem I suspect you all will have an easy answer for me.

I have two tables (People=Parent and Publications=Child). The people is simply a list of individuals and their mailing address. The publications table is a related table that shows the various types of mailings each individual is supposed to receive. There are a maximum of 15 mailings that one individual could be receiving.

I have created a single field in the parent table called people.publications. I would like that field to be replaced with all the related values separated by a hard return. In other words, I just want a list of the related values inside the parent table.

Ultimately, I would like this field (people.publications) to be populated based on a data entry screen that includes a checkbox set based on a stand alone value list (not table based).

Bottom line... how do I fill/append the contents of the various related records to a single field in the parent table? And are there issues with performing this fill that need to be considered knowing that I ultimately want to use a value list checkbox system to populate and perform finds on this field?

Thanks so much for your time.

Josh

(BTW: I wasn't really sure which forum to post this in. If this isn't the correct forum, please let me know where you think this question should be posted.)

Link to comment
Share on other sites

Well, as I originally designed the solution that houses these two tables, i decided it would be best to use the related table system. However, as I have begun to build the user interface, I felt that for purposes of creating the user interface to add individuals to or remove them from certain publications would be considerably easier if I use the checkbox system and a single field. Perhaps my perception is wrong, but a simple screen using a checkbox system that manages a single field of 15 unique values is easier on me to develop and makes not difference in the ultimate use of the data in terms of the users needs.

So, to answer your question... it is about making it easier on me (as a novice developer) to build the small solution I am working on for a friend than it might be using the related table system I currently have in place. Suggestions?

Link to comment
Share on other sites

It is not clear what you're trying to accomplish. To me, "a list of the related values inside the parent table" sounds like a description of a portal into the child table. Is there a reason you'd wish to have this information duplicated in the parent table?

Link to comment
Share on other sites

I do not want to use a portal for this portion of my solution. Do you know of a way to move the values (a single field from multiple records) from the child table to a single field in a single record of the parent table? i would like to combine all child values into one field in the parent table and do away with the related table for this portion of my solution.

Link to comment
Share on other sites

I think the only way to accomplish this is by running a script. Roughly speaking, the script would scan all the parent records (outer loop). For each parent record, the script would

(a) find the related records in the child table;

(B) in the child table, go from record to record (inner loop), setting the parent field to = parent field & CR & child field.

---

On second thought, if the child values are unique (or if you don't need multiple instance of a value), you can define - in the parent table - a value list using values from the field in the child table, with 'Include only related values" checked. Then you would do Replace Field Contents.. with calculated result, using the ValueListItems() function.

Link to comment
Share on other sites

This topic is 7000 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.