Jump to content
Sign in to follow this  
hioctane

Rep.Fields With Variable Index

Recommended Posts

Is there a way to store values in repeating fields using a variable index? All of the InsertXXX script steps require the me to put a constant index dictating the element of the field to insert into. I need FileMaker to decide at run time based on a value of a variable which element of the field to insert into. How do I do that? Thank you.

-ilya

Share this post


Link to post
Share on other sites

No, it would be nice if Filemaker had a SetRepetition() function to complement the GetRepetition function, but it doesn't. A messy workaround is to use the following script steps:


Set Field [gRepIndex, <<Desired Index No.>>]

Go to Field [TheRepeatingField]

Loop

  Exit Loop If [gRepIndex<=1]

  Go to Next Field

  Set Field [gRepIndex, gRepIndex-1]

End Loop

Insert Calculated Value [<<Desired Field Value>>]

The field has to be on the current layout, and all the field repetitions have to be in sequential tab order for this to work. You may want to create a special layout with only the repeating field on it.

I'm assuming that you are using repeating fields for some legitimate reason. grin.gif

Share this post


Link to post
Share on other sites

I'd rather go down the repetitions, then

if status(CurrentRepetition)=Desired Index

set the value

Share this post


Link to post
Share on other sites

Man, It's not my fault. I'm working on a database created by someone else, who apparently knew nothing about data modeling or relational database theory. Thanx you all for responces, BTW.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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