Jump 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.

Featured Replies

I have two tables, Parents and Children. My input screen for each parent contains a portal for entering children information. For each child added I now enter a child number manually. Is there a way to enter the child number automatically. That means for the first child entered, the child number is number 1. For the second entered, it's number 2, etc. Then if we delete one child, the numbers have to reevaluate itself.

The reason we need this is for charges. Each child in a family is charged less than the previous one. But if one leaves, we have to recalculate the numbers for the remaining children.

Currently, entering the child number is done manually. All the calculations based on the child number is done automatically.

Thanks.

Mike

Can you explain what the "calculations based on the child number" are? Wouldn't it be simpler to calculate the total charge at the parent level, using the count of children as the input?

in the child table use auto enter calculation with this function Get ( ActivePortalRowNumber ) - if your in FMP 11 earlier versions use Get (PortalRowNumber)

the only way to re-evaluate all the items in the list is to run some sort of update script on the children record by either looping thru the portal setting each row - or

going to the related children records looping thru them or replacing the Number + 1.

alternatively if you don't need to store the number - or use it in a calculation - you can just use @@ in the portal and it will always display the number of the row.

  • Author

Basically it's for charges in our day camp. For example, if the first child charge is $1,000, the second might be $50 less, or 950, the next child would be 900, etc. There may be other charges for the individual children, for example, one of the children may use bus service, that has an extra charge. So for each child in the portal we keep track of all their charges. In the family record we of course add them all up for a total family charge. Sometimes they may add a child or remove a child, so the number of the individual child may change. Thanks.

Mike

The reason I suggested calculating the overall charge at the parent level is that it's not as straightforward for a child to calculate its ordinal number among the siblings as it is for a parent to count its children.

If you still want to go that way, try defining a calculation field cListChildIDs (result is Text) in the Families table =

List ( Children::ChildID )




Then calculate the child's ordinal number as =




ValueCount ( Left ( Families::cListChildIDs ; Position ( ¶ & Families::cListChildIDs & ¶ ; ¶ & ChildID & ¶ ; 1 ; 1 ) ) )

Note that the ordinal number is calculated according to the sort order of the relationship.

Create an account or sign in to comment

Important Information

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

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.