Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I'm sure this is a "FileMaker 101" question so just call me an idiot!

I'm experimenting with repeating fields and for the life of me I can't figure out how to set the next available empty repetition. My little test script just replaces the first. How do you populate a repeating field?

Thanks,

Mel

Posted

for the life of me I can't figure out how

It's pretty easy, but not a required endevour ...since you by changing your approach to a more relational structure have this:

http://www.filemaker.com/help/Script-Steps20.html

However have Raybaudi, made the effords on your behalf:

http://www.briandunning.com/cf/472

...while I still think that you should avoid repeaters in your projects for a while learning relations instead!!!!!!!

--sd

Posted

I'm assuming that you are using the 'SetField' script step here...

There is more than one way to tackle this, I'm not big on repeating fields so someone else may have a much more elegant solution... Here goes..

Easy way..

When you use the SetField script step at the bottom of the dialogue box is a field that you use for the repetition. If you are populating a fixed repetition simply type in the repetition number.

The not so easy way..

If you need to calculate the next repetition number then you will need a field [number] in your table, you will increment this number via your script...

Field 1... Clients::NextRepetition

Field 2... Clients::RepeatingField

Script...

SetField[Clients::NextRepetition; Clients::NextRepetition+1]

SetField[Clients::RepeatingField[(Clients::NextRepetition)]; NewFieldContents]

When you stipulate the Repetition number as (Clients::NextRepetition) the script simply populates the next field repetition.

This method won't check that the field isempty first, so if you check out the LAST[] function in the help files you should be able to figure out a foolproofing method to prevent overwriting any existing data.

Like I said earlier, it's not elegant but it does work.

Posted

Soren is dead right!

The first link he has provided is exactly the way you should go and it is the method I use.

Hence why I am not big on repeating fields... use of relationships should be your first priority.

Posted

Thanks so much for all the help folks! I have read MUCH about avoiding repeating fields and have done so up until this point. BUT in this particular instance the repeating field comes in VERY handy. I am scanning documents that pertain to a certain record. The user can scan up to X documents and this number will vary depending on the "Job". I couldn't see creating 10,20 or 30 fields per record for 2 scans sometimes. These fields will not be relational, searchable or anything of the like. For me (in this case) the repeating field is ideal!

Thanks for all the input,

Mel

Posted

I couldn't see creating 10,20 or 30 fields per record for 2 scans sometimes. These fields will not be relational, searchable or anything of the like. For me (in this case) the repeating field is ideal!

Well technically they would be related.. you can just as easily (actually more... easily) dump them into a related structure (where the related table just has two fields, key and container) rather than dealing with them in repeating fields... That way you wouldn't have to set a limit either - But up to you i suppose.

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