Jump to content

Entering data to a repeating field


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

Recommended Posts

I feel this question should have a very simple answer, but I can't find any solutions in several reference books. How do I use a script to insert data into the next empty repeating field? The Repeating Functions seem to be for retrieving data, not inserting new data. Set field doesn't allow for a field value to dynamically set the repetition value. Do I have to set up a loop and manually count each field to find the 1st one that is empty, store that value then do a series of If statements before I can enter the value to a set field with the specific repetition value? (yuk).

Mark

Link to comment
Share on other sites

Big big applause to this recognition:

The Repeating Functions seem to be for retrieving data, not inserting new data.

This is correct!!!!! Ditch repeaters for a while, and learn about portals and relations instead. They (repeaters) have their uses but certainly not anything remotely connected to user interfaces!!!!

--sd

Link to comment
Share on other sites

Mark:

I agree with Soren; repeating fields are useful for holding data used by the db to do its work, but should never be shown in the interface - there are just too many limitations (as you're discovering), especially when you begin to add functions to an already-constructed system.

-Stanley

Link to comment
Share on other sites

Hi

Soren is right.

But what you want to do with repeating fields is a your decision !

So, for example and only to show you that FileMaker can make almost what you want, you can use this script:

Go to Field [ yourRepeating ]

Loop

Exit Loop if [ Get ( ActiveFieldName ≠ "yourRepeating" ]

If [ IsEmpty ( GetRepetition ( yourRepeating ; Get ( ActiveRepetitionNumber))) ]

Insert Calculated Result [ Select; "what you want" ]

Exit script []

Else

Go to Next Field

End If

End Loop

Link to comment
Share on other sites

Hi,

I'm currently trying to resolve this exact same problem. :P

I have a portal set up and I'm building a keywording relationship for it. I need to be able to have multiple matches. To this end, it seemed like a good idea to use repeating fields, with a value-list based on the keyword field's 'index', thus reducing the chances of data entry error.

I have made a global repeating field for one side of the relationship and I've also made the keyword entry field 'repeating' (again in the interests of ensuring that data is entered correctly)

This works fine ... except ... I also want to have a script which will fill the next available repeating field 'repetition' in a quantity of records. The choice of records is dependant on 1 of 6 other relationships (using FM8's tabs for different portals).

I understand that repeating fields is not a good idea for this ... so ...

My problems is that I want to use a the field's index via a value-list for entry, but if the field is not repeating then, the value-list will erase what's already in the field and also the user may well not 'separate' each keyword with a return.

I've thought about putting an invisible field on top of the keyword field and running a script to take the data entered and put it in the right place ... but what about deleting a keyword ... it all seems to be a bit messy.

How would you suggest I go about this?

Any pointers ... very much appreciated!!

Grant

Link to comment
Share on other sites

This is yet another attempt to scate on thin ice!

I have a portal set up and I'm building a keywording relationship for it. I need to be able to have multiple matches.

Its never advicable to make relations make the connection based on something a user can tamper with ...use ID's for the matching.

Beyond that could it be said that, if omissions in a repeating field occures doesn't it have any influence on the matching as long the key value is present somewhere.

My problems is that I want to use a the field's index via a value-list for entry, but if the field is not repeating then, the value-list will erase what's already in the field and also the user may well not 'separate' each keyword with a return.

I'm not quite getting this, you can always get hold of the index by pressing command and I with the cursor standing in the field arranged neatly in a dialog box without "holes in the cheese"???

--sd

Link to comment
Share on other sites

Hi Soren,

Thanks for the reply. :P

Its never advicable to make relations make the connection based on something a user can tamper with ...use ID's for the matching.

Well ... I would, except that the 'keywords' are user-defined. They make what they want.

Beyond that could it be said that, if omissions in a repeating field occures doesn't it have any influence on the matching as long the key value is present somewhere.

Yes ... I noticed that an empty repeating repetition makes no difference to what comes in the next repetitions .... they still match

I'm not quite getting this, you can always get hold of the index by pressing command and I with the cursor standing in the field arranged neatly in a dialog box without "holes in the cheese"???

Yes ... but it replaces the enitre contents of the field. I don't think I can repeatedly 'add' values to a text field, without getting into some kind of loop, 'isActive_Field' script. Right?

Are there other ways of doing this more elegantly?

Grant

Link to comment
Share on other sites

Hi Soren,

thanks for the further help. :P

This is what I meant by my looping thing ... but I can see that this will be *far* more elegant. I didn't even realise that this was a possibility. So much to learn, and so little time ... mustn't forget the real work too. :

Grant

Link to comment
Share on other sites

Ray,

Thanks for the code. I'll give it a try. I have rarely used repeating fields, since I find relationships much more friendly, but this application is a small part of a huge system (>150 open files)and I really didn't want to add to that number for such a trivial audit-trail function. I haven't converted to version 7 because I didn't want to fix the 1000's of scripts that are out there that don't have the same functionality after the conversion as they had before. (I've tried).

Mark

Link to comment
Share on other sites

This topic is 5768 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
 Share

×
×
  • Create New...

Important Information

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