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

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

Recommended Posts

Posted

Hi,

I am using repeating fields in my project.i want to delete repeating fields row by row instead of deleting all the record.

it's possible in fm to delete repeating fields row by row.plz help me .

Thanks,

John

Posted

Beyond you need to explain why your repeating fields not are calc'fields only ... and honestly only have proper deployment when used to utility purposes only.

http://www.kevinfrank.com/download/2009/clear-repeating-field-via-lookup.zip

But I need to caution you against using repeaters if the same matter could be solved via genuine relations, hence my expectation of calc'fields only when dealing with repeating fields.

--sd

Posted

Do you mean Portal Records?

Why not Post a copy of your file, so that we can better understand your question.

Lee

Posted

What you just said is no surprise to me, it's what I already took for granted. What I didn't see though is why you use repeters at all, since they are a bad substitute for a one to many relation, what do they solve that can't be done with a portal and a few related tables.

This means you have to cough up a plausible context and purpose, and not just rephrase the original question, because the likeliness of giving you an answer just in the vicinity of what you wish ... is not that big. Explain your love affair with repeaters - please!

By all means stop asking abstract open ended questions, if what you need is the opposite of an generalized and not particular precise answer.

--sd

Posted

I am using repeating fields in my project

John, repeating fields are not good for data. As Søren says, a standard relationship is truly the way to go.

Posted

Before fm3 wasn't fm relational ... and even though thats back in the beginning of the 1990'ies have the backwards compatibility been kept ... but there are as well developers who can do incredible things with them, but all these purposes fall in the "utility sector" for temporarily massaging very specific data. As a rule of thumb would I suggest you abide to "the users have no access to write data to them"

--sd

Posted

I'm certainly in agreement with the advice above (use a portal to a related table rather than a repeating field) but I think your original question deserves an answer.

When you say "Delete repeating fields row by row", my interpretation of this goes something like this: Say you have a repeating field with (for example) 10 repetitions. Each of those has some data in it. You want to zero out (for example) repetition #6, and have all of the repetitions below it shift one entry up.

You can do this with a looping script. Set a variable $count equal to the targeted repetition number -- the one you want to "delete" -- and then Set Field (yourfield[$count]) to the value yourfield[1+$count]. Then increment $count and loop (put an "exit loop if" condition to trigger when $count is the maximum number of repetitions. After exiting the loop remember to blank out the final one.

I've never actually tried this but I think it should work.

From a design perspective using repeaters like this is kludgy and awkward, but if you already have a working solution it might be better to just hold your nose and do it this way rather than redesign everything from the ground up.

Posted

but I think your original question deserves an answer.

It does, hence the reference to the Kevin Frank template as if provisions doesn't exist :qwery:

--sd

Posted

I guess I'm missing something in the Kevin Frank template -- how does that show "deleting row by row"? The original question didn't say anything about lookups.

Posted

Sorry I lost track of the original premises. Since the OP is on fm10 is there a welcome simplification possible:


Set Variable [ $tt; Value:"cleartheRepeater::aField" & "[" & Get ( ScriptParameter ) & "]" ] 

Set Field By Name [ $tt; Case(0;0) ] 

Where the script parameter then selects the repeater to clear.

--sd

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