Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Specify Repetition Number

Featured Replies

Hi Everyone

I would like to set a repetition by specifying the repetition number to set using a calculation.

See example of my failure :

best

Stuart

SetRepByCalc.fp7.zip

Interesting. The repetition of the target field seems to be evaluated outside the context of the portal. It looks like you need to use a script parameter instead.

BTW: If you set the rep with this calc:

Let( rep = Related::Repetition ; rep )

the rep variable contains the right number, but with this:

Let( $rep = Related::Repetition ; $rep )

the $rep variable contains always 1

WHILE

if you set this calc:

Let ( $data = Related::Data ; $data )

$data contains ALWAYS the right data

So, the final question is:

Why $rep contains always 1 ?

Why $rep contains always 1 ?

I think that FM haven't time to evaluate...

So the solution is to make a script of two steps:

Set Variable [ $rep; Value: Related::Repetition ]

Set Field [ Main:: Repeating Field [ $rep ] ; Related::Data ]

... and attach that to the button.

SetRepByCalcSolved.fp7.zip

If you set the rep with this calc:

Let( rep = Related::Repetition ; rep )

the rep variable contains the right number

I don't see that.

Why $rep contains always 1 ?

I think that FM haven't time to evaluate...

It doesn't always contain 1. It contains the value from the first related record. Because it is evaluated from the context of the parent record, not from the context of the portal row (or at least that's the way it seems) .

So the solution is to make a script of two steps:

Set Variable [ $rep; Value: Related::Repetition ]

Set Field [ Main:: Repeating Field [ $rep ] ; Related::Data ]

Or just one step, if you use the script parameter as suggested.

Another option is to set the repetition to:

GetNthRecord ( Related::Repetition ; Get ( PortalRowNumber ) )

but this will work ONLY IF the portal's sort order is the same as the sort order of the relationship.

Edited by Guest
Removed the part about filtered portal

I don't see that.

You are right... I had seen that ONLY in the Data Viewer putting the calc into it.

Not on a Mac (because of the delay in calculating the tip).

Is that true also on the last PCed MACs ?

I'll tell you for sure when I get one! But I would assume the answer is yes, because the delay is intentional, not due to a processing problem.

BTW, they are not PCed, they are Macs with an Intel processor. :

  • Author

Thank you both, that's really great :

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.