Jump to content

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

Recommended Posts

Posted (edited)

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
Posted

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

Posted (edited)

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
Posted

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.

Posted

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 ? ?

Posted

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 ( ) .

Posted

Thanks Barbara, that worked wonderfully!!

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

Posted (edited)

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

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