jschwarz Posted September 9, 2004 Posted September 9, 2004 I posted this in the import forum, but it's a bit low traffic. I'm converting an older version of a database into a newer one that we've developed for a non profit doing fundraising. The old DB has "home phone", "address phone", and "other phone". The new DB has a 5-field array of phone numbers, and a corresponding popup menu with phone types, including fax, work fax, etc. Is there any way to map the separate fields from the old DB to be imported into the array? Otherwise, I can only import the home phone, essentially. Can someone let me know if this is feasible with FMP, or if I'm going to have to do this manually (yikes)? Thanks
Fitch Posted September 9, 2004 Posted September 9, 2004 If by 5-field array you mean 5 fields, I don't see a problem. Just import and then set the phone type fields with a script. However, if you mean a repeating field with 5 reps, I would set up 5 temporary fields to hold the numbers for the import, then use a script to loop through the records and set them into the repetitions.
jschwarz Posted September 9, 2004 Author Posted September 9, 2004 Yes, it is a repeating field with 5 reps. Can you point me to a code example for a script that does something similar?
Ugo DI LUCA Posted September 9, 2004 Posted September 9, 2004 Hi, At first I'd use a calculation to combine your old fields in one with separators. c_AllPhones = Choose(Is Empty(HomePhone);"Home"& "
Ugo DI LUCA Posted September 9, 2004 Posted September 9, 2004 Ok, I ran a very quick test. You need a counter say gCounter (num) in this script, that wouldn't show in this layout, and remove the serial from this "Loop layout" so that only the 2 reps in the Tab order defined above are shown. Show All Records Go To Record [First] Go To Layout [Loop] Loop GoToField[serial] SetField[gCounter;0) Loop EndLoop If [gCounter = 10] SetField[gCounter;gCounter+1] NextField SetField[ ; Middle("
Fitch Posted September 9, 2004 Posted September 9, 2004 Seems like overkill to me. You can easily set data into field repetitions, just specify e.g.: Set Field (phone type -1, "home") Set Field (phone -1, home phone) Set Field (phone type -2, "work") Set Field (phone -2, work phone) etc. I have to wonder why you want to use repeating fields for this, especially since you're using FM7. You could set up the phone numbers in their own table and be totally flexible.
Recommended Posts
This topic is 7747 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 accountSign in
Already have an account? Sign in here.
Sign In Now