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.

Problem with calc on New Records

Featured Replies

Hi, I have a strange problem I wonder if the answer is obvious to you.

I have my 3 tables. The main layout is the Master table with a portal to the other 2.

I have imported the existing data into all 3 tables.

When I take any existing record and do a calculation

GetNthRecord ( Members t_ID::t_FirstName ; 1 ) & " " & GetNthRecord ( Members t_ID::t_LastName ; 1 )

it returns the full name of the member.

==(Problem)

Now if I create a New Record and fill in all the data in the Master table as well as the Members table this calculation returns no data.

I scratched (or banged) my head for quite a while. Eventually I found that if I turned off "Do Not Evaluate if all referenced fields are empty" the full name showed up as a result. Hooray.

Except this caused a problem with any empty record in the portal creating a ? ? as the name.

So I turned the Do Not Evaluate checkbox back on. To my surprise the calculation now displays the full name for this New Record.

However if I create another record the same thing happens again . . . no name, unless I turn off the Do Not Eval checkbox.

So - any idea why this is happening, and what can I do?

Many Thanks for all your help,

jim

Edited by Guest
correction

Hi

first of all, why you use this calc:

GetNthRecord ( Members t_ID::t_FirstName ; 1 ) & " " & GetNthRecord ( Members t_ID::t_LastName ; 1 )

instead of a simpler:

Members t_ID::t_FirstName & " " & Members t_ID::t_LastName

  • Author

Thanks Daniele,

Because there are (usually but not always) multiple Member records in the portal.

So there is also

GetNthRecord ( Members t_ID::t_FirstName ; 2 ) & " " & GetNthRecord ( Members t_ID::t_LastName ; 2 )

GetNthRecord ( Members t_ID::t_FirstName ; 3 ) & " " & GetNthRecord ( Members t_ID::t_LastName ; 3 )

GetNthRecord ( Members t_ID::t_FirstName ; 4 ) & " " & GetNthRecord ( Members t_ID::t_LastName ; 4 )

etc., etc.,

Edited by Guest
trying to be clearer

Except this caused a problem with the ghost record in the portal

That cannot be the reason for the error. The calculation works directly through the relationship, not through the portal.

However, if you hard-code:

GetNthRecord ( related::field ; 4 )

and there are only 3 (or less) related records, you WILL get an error as a result.

What are you actually trying to accomplish here? There is probably a better way.

  • Author

I'm just trying to extract the names of the members in the portal to put into a Letter. So I'm using the calculation above (c_Name1, c_Name2, etc., ) to extract them and I put them in the Letter in the form

<>

<>

etc.,

There are anywhere from 1 to 10 Members in the portal depending on the Family (Master table).

I've used to GetNthRecord to send emails to each member in the portal and that works.

And I've used it to collect the names and it works except as I said it doesn't work for New Records that I create.

==Correction:

I was mistaken in my first post in that if I remove the Do Not Evaluate checkbox from the calculation dialog - all of the empty portal rows (not just the ghost row) will generate a the symbols ? ?

I think you'd be better off using List ( relationship::FullName).

FullName is a text calc in the child table = FName & " " & LName.

Basically, create your string in the child and gather it into the parent using List ( ) .

  • Author

Thanks Barbara, that worked wonderfully!!

Although I'm still confused as to why my original logic didn't :

Although I'm still confused as to why my original logic didn't

my guess is if you commit the record and refresh the screen, the new record would have calculated as you wanted it to.

If you want to test it, create a script with those two script steps in that order, create your new master and related records, then run the script.

Edited by Guest

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.