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

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

Recommended Posts

Posted

I am trying to skip a line in a repeating field.

I have a number of records that I want in a report that contains repeating fields. I have a script that sets the rep field value based on the count of the field + 1. The records are sorted by group (A B C D). A I loop through the records if the group changes from A to B and so on I would like to skip the next rep field. I have inserted a set field using " "(spaces) as a value list.

Then if the value from A does not match B insert the space and enter the value of B in the next rep field. This will only work if I go to the report layout then back tp the original layout. Without changing layouts it does not work.

Any Ideas?

Thanks

Posted

I've in my past earned a reputation as the Grand Inkvisitor in this forum, probably by some not quite aware of the outcome in the "Brothers Karamasov" ....but my expirence is that all newbee's are attracted to repeaters like flies around manure.

But where the manure is fertile depot for fly offspring are repeaters not quite up to it as storage. Repeaters can although charming at first sight, only be utilized as structures serving special tasks ...but not direct storage of userinterfacable data.

You'd better explain why your choise have fallen on repeaters as vehicle for you database aspirations? Because they're going to get you perspirating, much much more than if you take the plundge into relational designs.

Save repeaters for later when you get the hang of developing.

--sd

Posted

Thank you SD

I know repeaters are troublesome. I am using them in a report. It looks better overall(for me). In order to accomplish what I need I would have to have way to many fields and I just thought repeaters would work best

Thanks

Posted

Ok you can perhaps pull it off, using a combination of Get(CalculationRepetitionNumber) as argument for GetNth( and Case( make it display to your hearts desire, but be prepaired for a rough ride.

http://www.filemaker.com/help/FunctionsRef-214.html

http://www.filemaker.com/help/FunctionsRef-38.html

--sd

Posted

Thanks SD

I have attached a sample file to show what I am doing. If script col1 is run it works fine. Spaces are entered between the three groups. the script col2 does not put the spaces in. the only difference between the two scripts is goto layout steps. This may not have a fix but I hope so

jc

test_repeating.zip

Posted

This will only work if I go to the report layout then back tp the original layout. Without changing layouts it does not work.

Any Ideas?

Because it's a relation away the action takes place, are you bound to Commit the record, which the flipping back and forth does as well. Committing is the same as clicking outside a field.

Sort Records [ Specified Sort Order: Records::Group; ascending ] [ Restore; No dialog ] 

Go to Record/Request/Page [ First ] 

Loop 

      Set Field [ test repeating::Col2[Count ( test repeating::Col2 ) + 1]; Records::Group ] 

      Go to Record/Request/Page [ Next; Exit after last ] 

      If [ GetRepetition ( test repeating::Col2;Count ( test repeating::Col2 ) ) ≠ Records::Group ] 

            Set Field [ test repeating::Col2[Count ( test repeating::Col2 ) + 1]; " " ] 

            Commit Records/Requests [ Skip data entry validation; No dialog ] 

            Set Field [ test repeating::Col2[Count ( test repeating::Col2 ) + 1]; Records::Group ] 

            Go to Record/Request/Page [ Next; Exit after last ] 

       End If 

End Loop 

You might as well notice that I've changed you GetField(" statements to straightforward references ...same thing happened to you GetValue(" - because they aren't needed.

But the whole thing originates from you not trusting filemaker unless measuring the value actually is set, but the script would benefit from exploiting $variables instead, so every time the special condition is met will the variable added 1 to make it offset, for the remaining scripting.

There are other things, the scripts as such needs to get to the right layouts as long as Sort and Go to Record should have a meaning.

You can save some fields, the meaning is that the utility layout many2one is going to be just one record, so dependant of the found set should you turn to it and watch values in the repeaters. This is better done with a cartesian product relation that only during establishing a relation, when the connection is made carthesian can you delete the two fields afterwards than the indexed equijoin you made.

There can be points in the way you do things, compared to Sum( and especially Summaries that requires preview to be seen. But you're highly reliant timely sycronization. That you use repeating field instead of descrete fields is where it becomes unusual.

--sd

Posted

SD

Thank You I applied the changes and it worked fine. This gets me out of the hole I was in and now I can try a better way since I am not in a bind. I am still learning.

Thank you again

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