November 23, 201510 yr Greets, all, and I hope you're in for some eats and treats later in the week. Please refer to the attached. What I'm doing is creating ten child records with the creation of each parent; each child is populated with a different value (in quotations) destined for the Inclusion__lxt field. As is, it works, but it's clunky; in my never-ending quest to become more competent with FileMaker, I'm sure there's an elegant way to loop this but I don't know how. (I'm sure it involves an Increment-type step to pick the appropriate value with each iteration, but I be flummoxed.) As always, your help is appreciated. Thanks!
November 23, 201510 yr Set Variable [ $list ; "Awards¶CV¶Military¶Objective etc... ] # Hopefully this is a value list or records in a table instead or separate the values using List ( "Awards" ; "CV" ) etc. Set Variable [ $ParentID ; RESUME_INCLUSION::_kflt__ResumeParentID] Freeze Window Go to Layout [ based upon child table ] New Record/Request Set Field [ child::parentID ; $ParentID ] Loop Set Variable [ $i ; $i + 1 ] Set Field [ child::Inclusion ; GetValue ( $list ; $i ] Exit Loop If [ $i > ValueCount ( $list ) ] Duplicate Record #in this way, the child record inherits the parentID so it does not need to be set End Loop Go To Layout [ original layout ] This is untested. Sorry I didn't follow your table/field names exactly ... I usually do. But when they are not easy enough to type by hand, it is frustrating to me and I drop them, particularly stuff like '_kflt__' :-)
November 23, 201510 yr 2 hours ago, WF7A said: I'm sure there's an elegant way to loop this Actually, the elegant way is to create records only when you have something real to put into them. If you want to present your users with a "grid" against which they can enter data, use a portal to a table of Attributes (where each one of Awards, CV, Education, etc. is an individual record) that can create records in the "real" child table - see a similar example here: http://fmforums.com/topic/98488-show-a-portal-of-potential-entries-not-yet-created-based-on-dates/?do=findComment&comment=447756
November 23, 201510 yr Author Thank you both! I'll play with your solutions today.--it'll be nice and quiet in the office this week so I'll be able to spend some time with them. Cheers!
Create an account or sign in to comment