Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

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

Posted

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?

Posted

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.

Posted

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

Posted

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.

  • Like 1

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