Jump to content

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

Recommended Posts

Posted

I came across a bug today when using Set Field [] where you sum up the first rep of a repeating field without explicitly stating it is the first rep and the target being another repeating field regardless of if it is in the same field or not.

 

In other words, if you do not explicitly state the field with rep 1 such as MyField[1] or GetRepetition (MyField; 1) but rather just refer to it as MyField it will ignore the value.  However if you use it in a calculation field or the target field is non repeating field it works as I would expect.

 

I made a test file and I tested it both with FM11 and 12.


Whether you use the + sign or the Sum function the results are the same:

1. If you do not explicitly set the repetition for rep 1 then
    A.  It will ignore the value in rep 1
    B. Set the target rep with evaluation of the rest of the calculation without the rep 1 value
    C. If you hit the button subsequent times the value will keep adding the same amount without overriding the existing value

2. Everything works fine when using a calculation or another field as the target
 

repeating_field_sum_bug.zip

Posted (edited)

Hi John,

 

AFAICT, this is a feature, not a bug: when you set repetition N of a target repeating field with a calculation involving a source repeating field, Filemaker will interpret a reference to the source field as SourceField[N] - unless you override this by stating the repetition explicitly. So the first repetition is not being ignored, it's simply understood to mean rep. #11.

 

I don't think that the source and target fields being the same makes a difference.

 

 

I haven't gone over all over your scenarios, so if there is one that doesn't fit this theory, please point it out.

Edited by comment
Posted

Hi Michael,

 

Well if it is a feature, then it is an extremely vague one if at all and of course once again not documented.  Why would someone assume that by simply having the field without the explicit repetition, represent the field they are targeting especially when it does not behave that way in any other cases where there is only one repetition as the default...

Very strange feature indeed.  BTW I didnt put it in my example, but using a repeating calc field behaves the same way. This would coincide with your theory Michael. Thanks for looking it over.

Posted
it does not behave that way in any other cases where there is only one repetition as the default...

 

I am not quite sure what you mean here. It behaves the same way as it does with a repeating calc field (as you yourself point out).  In a calc field, that is a very useful feature to have. I don't know if it must be the same when setting a field, but I guess it makes sense somehow.

  • Like 1

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