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.

GetNthRecord HELP!

Featured Replies

I am trying to set up portal Navigation as described by Ray Cologon. After many hours of trying to get this to work I have "Most" of the problems solved. My main problem remaining is that when I click on the portal row the GTRR does not take me to the record. There is a CF as follows:


GetNthRecord (Field; StartValue ) & 

If(IsValid(GetNthRecord (Field; StartValue + 1)); 

¶ & GetValueSet(Field; StartValue + 1))

When I tried setting this up in a script to see where the problem was I get a seven digit number for RecordNumber?:D? so if I change it to the proper record number it goes to the correct record in the layout.

Somehow I've got this huge number stuck somewhere, but, I can find no way to clear it. Can anyone suggest what I should do?

Thanks.

Al

The CF you quote returns a LIST of values from Field, starting from Record #StartValue, separated by a carriage return. I don't think it was meant to be used in a GTRR step.

Well I'm of another meaning here it's meant as keyvalue for a GTRR, the resulting field has to be text and not number to work although the original field is number.

--sd

  • Author

Well, that's what is confusing the heck out of me. The calc field cFoundSet_Mkey is set to return as text, however, the field it refers to is a number field. Do I need to change my ContactID to text as well? This field is used in many tables, will the other relationships fail if I do so?

Btw, the number I was getting was 1618342622. I clearly don't have over a billion records. I started to play around with it and now it shows the current contactID not the RecordNumber.

  • Author

I tried changing contactid to text in my development version and it still does not work.

For whatever reason the Get(RecordNumber) is being replaced by the ContactID number.

1618342622

Im guessing here - should it look like:

1

61

83

42

62

2

:D?

--sd

  • Author

No, this number shows in a dialog box when I run a script with debug on using the GetValueSet CF that is in the demo package from NightWing.

I've added an image of a script I'm trying to use just to see what is wrong. As I go through the script and ask for record number the correct record number shows in the dialog box. When i hit the CF the large number appears as the record number in the dialog box. I have no idea where it came from. However, as I said that number is gone now. What I'm getting instead is the contact ID. I'm totally confused and probably I'm confusing everyone else as well. :D

Any help is appreciated. Thanks.

Al

GetValueSet_Script.JPG

It would be better to tell us what you're trying to achieve. As it is, I can only see - vaguely - what you're doing. You are telling Filemaker to go to record # << a list of numbers here >>.

  • Author

Everyday we each have about 30 - 50 calls to make. My app opens with all calls (FollowUps) in the found set. We then wind up working with these calls most of the day. It is rather cumbersome to try to find and go to a specific record when you have 30 - 50 records in your found set. So I would like to have a portal from which I can find the name of the contact I wish to call or who has returned my call and quickly bring up that record (On the same layout) by clicking on that record in the portal. I found an example done by Ray Cologon of Nightwing called Portal Navigation which did exactly what I wanted using a CF and GTRR in the portal. The problem is the CF is not getting the correct record number and, therefore, goes nowhere when you click on the name in the portal. My file and Rays file are too big to upload, but I'd be happy to email it to you to look at. Thanks.

Al

Could you just follow the relationship back to the record that is showing in the portal?

What table are the portal items being pulled in from?

If you're using a script to get data from a portal, make sure the script is referencing the correct table occurrence when it grabs the information. Or you can use a script parameter and just have the button in the portal pass the script the correct record number.

But I'm really still not clear on why you want to do it the way you want to.

  • Author

Here's a screen shot of what I am trying to accomplish. I also added a screen shot of the demo file I am working from. I hope this helps clarify what I'm trying to accomplish.

Right now I have to jump out to a list view to see the entire call list, find the contact to call and then go back to the individual record. It is very cumbersome.

SGI_Contacts_Screen_Shots.pdf

I am assuming Ray's demo is working as expected, so obviously you are not implementing it correctly. I could also make you a demo showing how it can be done, but I don't see the point, since you already have Ray's demo in front of you.

I did spot one mistake in your script, and I have already tried to draw your attention to it twice. IIUC, the GetValueSet() CF is designed to get a list of the found set's ID's into a field - so that you can have a portal based on the found set. Using it again in the navigation script does not make sense to me.

  • Author

Hi Comment:

I put it in a script so I could use the debugger to see what was happening. It was not my intent to develop a script. I did it out of frustration because the GTRR was not doing what it was supposed to do and I had no idea why. Once I put it in a script I saw that it was not getting the correct record number, but, that huge 11 digit number.

I agree, obviously I have done something wrong. I just can't get my head around what it might be. I have been working and reworking this thing all day hoping to find an answer to no avail.

I have gone back and forth between Ray's demo and my app and have to make sure I didn't copy something wrong. Everything appears to be correct, so I must assume I am missing some small, dumb thing that should be hitting me upside the head and I just don't see it.

As I said earlier I'd be happy to show you all the app, but, it is 1.8mb, too large to upload. I'll email it to anyone who thinks they can or is willing to assist me.

H - E - L - P !!!!!!

Al

Why don't you try with a new file and a single table. See if you can make it happen. If yes, you will have learned how. If not, post your test so we can spot where you went wrong.

Hi Al

Also, can you post a screen-shot of the relationship ?

Is your portal showing the records you want properly and if so, why not use the "Go to related record" script step?

If you want the information to fill in after you click on a portal row, then you need yet another field to use in yet another relationship that will contain the contact id of the person whose record you want to view, and that field should be related to the table that contains that information. That field would also be filled in via the script step. You don't want the record number but the contact id. All the data fields that you want to view the related information in should use the new relationship to pull their data.

If that is what you're trying to do, be careful. Make a backup of your file. And if you could post a screen shot of your relationships and table occurrences for the layout you're trying to modify, it would help. Without an understanding of your database structure, we really have no clue which direction to point you in.

And like I said, if your portal is working fine and the records in the portal are exactly the same records you want to view, merely going to the related record should be sufficient.

  • Author

In reply to all:

I am attaching a pdf showing the relationship graph, the CF, the calc field, and a screen shot of the layout. The calcs somehow were commented out when I copied them over. They have since been corrected.

I am using my development file with limited data so, I'm not worried about corruption or failure at this time I can always make another clone of the original.

To Coconut:

Yes, the portal is showing the correct records. As I said earlier the only reason I set up a script was to see why the GTRR was not working.

Take a look at the relationship. Are you saying I need another TO between Contact Names and Navigation portal? Ray Cologon suggested I change my contactID field to text to match the cFoundSet_Mkey. But, here I'm confused as well. The cFoundSet_Mkey is a calc field set to evaluate to text. Does that matter? I wouldn't think so, but hey you never know.

Thanks to all for your continued assistance, it is greatly appreciated.

Let me know if you need anything else.

Al

Navigation_Portal_setup__1_.pdf

I think the weird numbers and error you were seeing were because the Go to Record/Request/Page [] step can only accept a single number as a calculated value, but that CF returns a list of numbers.

But in any case, you should try to troubleshoot the GTRR problem (the CF itself must be working if you can see the found set in the portal.) Ray just had a button defined with a Go to Related Record [ Navigation Portal ], but the same thing would work in a script step, but be sure to remove those other script steps.

  • Author

Ender, Ender, Ender:

Thank you, Thank you, Thank you!

I said all along it had to be something that should kick me upside the head that I was missing.

But in any case, you should try to troubleshoot the GTRR problem (the CF itself must be working if you can see the found set in the portal.) Ray just had a button defined with a Go to Related Record [ Navigation Portal ], but the same thing would work in a script step, but be sure to remove those other script steps.

I had the GTRR pointing to the data table rather than the Nav portal table. Back to Filemaker 101 for me. ;)

It is now working.

Thanks again to all for your assistance.

Al

So I would like to have a portal from which I can find the name of the contact I wish to call or who has returned my call and quickly bring up that record (On the same layout) by clicking on that record in the portal.

Rays template makes a selfjoin show a found set of records in a portal, this is a result of an ordinary search, where the found set is traversed for recordID's so it can be stuffed into a calcfield which act as primary key for the portal.

What puzzels you is the use of a Calcfield for the purpose, but lets see how you can accomplish the desired response in by making an extra button next to the omit button in each line in Rays template:

Lets call the script SingleOut:

Freeze Window 

Go to Related Record [ From table: “FoundSet”; Using layout:  ] 

Omit Record 

Go to Related Record [ From table: “FoundSet”; Using layout:  ] 

Show Omitted Only

Which is just a slight modification of the Omit buttons script.

--sd

Edited by Guest

This is a little off the subject: but I was puzzled by Ray's demo, trying to figure out how the portal row highlight graphic updated itself without a script. It was a clever use of the let[] function in one of the calcs to update a global script variable that was then used in the highlight graphic calc.

That CobaltSky can be pretty clever! :clap:

Hey Al,

Glad you got it working. The one screenshot you didn't provide was one with the Go to Related Records[] step, so I couldn't be sure. Nice when the "Process of Elimination" yields the correct answer!

:waytogo:

  • Author

Funny you should mention! ;)

But I can't get that to work either and it is really cool. Can you give me a hint as to what I should look for. I'm sure it's another simple thing I'm missing.

My main confusion is I'm pretty sure I need to enter a color into the container field. Although I've done it before with Danelle's assistance I can not remember how you do it. Any suggestions.

Soren:

I'll give your script a try. I need all the help and training I can get. Thanks for the idea.

Al

Sure. On the layout, add the 6th repetition of the gResources field (this is where the highlight graphic is apparently stored.) Then in Browse Mode, insert whatever highlight graphic you want. Once it's in there, you can remove the gResources field from the layout.

  • Author

Hey Ender:

Where did you find that Let() statement in Ray's demo. I can not find it in his demo or my app either. Yet, the hilite function works in his demo, but not my app.

Al

It's in the cNavText calc, or in your file, the cNavText 2 calc.

  • Author

Yep, I see it and it looks like it all copied over properly. So why no hilite? Any ideas as to what I should be checking?

AHH! I've spoken about the wrong template, however is it almost the same trick required, in the template dupe the omit button and stuff a script in it:

Omit

Show Omitted

...the plugin takes care of the rest, but basicly is it the same mechanism as this http://www.nightwing.com.au/FileMaker/demos8/demo804.html - To make a found set and let an unstored calc capture the ID's of the ones not omitted

So why no hilite? Any ideas as to what I should be checking?

The way it's layered the hilite needs to be behind the text, due to the lack of transparency.

--sd

  • Author

Hi Soren:

I have placed the Highlight field behind the name field and set the name field to transparent. Please see attached PDF of how I have it set up as well as the calculation fields, etc. Perhaps you will be able to see what I have done incorrectly. I have been back and forth between my app and demo dozens of times and made multiple changes and I can not get it to work.

Thanks for your help and I have looked at the PortalFoundSet demo as well.

Al

Hilighting_problem_with_Portal_Nav.pdf

Thats a little more than intended frankly, things that needs to be assured is that no edge of the highlite covers any outline, another issue is that only having the calcfield unstored makes it behave correctly.

But there is another issue, that have occured to me. Both templates deals with selfjoins, and if your ties in the graph is made with TO's stemming from different tables, is the found set somewhere else ...to be honest. So the trickery with the unstored fields reflecting a found set in the same table - have to be changed into a script setting a global text field with the gathered ID's in order to produce a primary key for the relation.

So the next step is to reveal your graph...

--sd

Edited by Guest

  • Author

Hi Soren:

I've attached a PDF showing graph and calc field set up for the calc that contains the let() statement.

Please keep in mind at this point the portal is working perfectly. It is the highlight feature that is not working.

Also, I checked my widths and lengths on my portal rows. The Portal is 173 px wide and each portal row is approx 18 px high. My container/calc field and data field is 150 PX/13PX.

I could easily implement the portal navigation system as is, but, I am a stubborn old fool who likes to have it all and it bothers me that I can not get the highlight feature to work, which I think is really cool. ;)

Thanks for your continued assistance.

Al

Navigation_Portal_setup__2_.pdf

Hi Al,

I suspect that you may have that calc container based upon your detail TO. If these fields are mis-specified, you will get the effect indicated in your pdf (all rows highlighting). Other examples of misspecification are names repeating etc. Right-click that calc container and make sure Specify Field is using Nav. But why the rows (when clicked) turn white? Have you checked field behavior and make sure none of those fields can be entered in Browse mode?

Just some ideas ... I know what it's like trying to figure these things out. Otherwise, you might need to post your file. :wink2:

BTW, the size of that calc container doesn't matter ... what matters is that it doesn't touch the top and left edge of the portal. There is a 1-px. leeway here. Try moving it down and to the right a few px. just to be sure. Then, one px. at a time, move it up - go back to browse to make sure it's still displaying, then move it again until it wonks. Then you'll know you're as far up and left as possible.

LaRetta

Edited by Guest

Now that's all sorted ... a bit off-topic now but I was surprised nobody poined out to Al that Soren was correct way back. In Data View, FMP is smart enough to ignore the paragraphs in a list of values, so a list of numbers looks just like one long number. There is spacing between each of the numbers but it's easy to miss.

Perhaps it would be smarter (and less confusing) to use the "¶" character as the separator.

  • Author

Hi LaRetta:

You nailed it. Thanks so much. I'd never even noticed the Specify Field option before. I spent three days on this and then some and it wound up being two minor little issues that without the help of all of you I still would not have found.

I just have to say that in all my years I've never run into such a sharing group of people. You guys are great.

Thanks,

Al

Glad it did the trick, however a bit of advice ...you'll never stumble over two developers thinking identically and the graph you uploaded of your relations - reveals too little to be constructive to anyone else in a workgroup. If you collapse the boxes to show connections only and rudimentary info here and there are they tough to investigate.

What would have helped me would be a colouring scheme showing TO's stemming from the same table, to establish if you had any idea why Rays template works. It was obvious that you still didn't in this post where you posted this http://www.fmforums.com/forum/showpost.php?post/202799/ ...where Rays template gets into terra nullius is that he avoids lengthy scripting and tampering with the clipboard, there is nothing new in either multilinekeys or GTRR's in selfjoins when portalizing found sets.

But the way the found sets are made by simple searches, instead of multicriteria relationships where one of the legs are a strainer list of omitted as a multilinekey - is a matter of organizing the data. I paid attention to this:

My app opens with all calls (FollowUps) in the found set. We then wind up working with these calls most of the day. It is rather cumbersome to try to find and go to a specific record when you have 30 - 50 records in your found set

...and it made me think of the temporay nature Rays approach are designed to handle... aren't you're forced to make new searches each morning to make a found set to work on?? My point is such matters could be done with multicriteria relations and ValueListItems( so you aren't forced jump hoops around that selfjoin Rays template demands to work.

This template comes to mind:

http://www.newcenturydata.com/downloads/filter.zip

...where contacts requirering a call within a certain span of dates are listed in the portal, with the exception of the ones already contacted in yet another criteria/multilinekey using the unequal operator instead of storing such info in the clients record ...I say this out of personal preference, because I think Rays template is cute, but it's requirering you work around the selfjoin, which can be tough to document sufficiently ...so you after 1 years use suddenly needs to change something, is it not that easy if you have forgotten the trickery applied.

Another thing I noticed is that you use a plentora of fields in a pretty flat structure, you might get inspiration from this approach:

http://previews.filemakermagazine.com/videos/513/DataTagging_full.mov

--sd

  • Author

Hi Soren:

Next time I will make sure my graphs are open so you can see my relationships.

Yes, In fact, everyday when a user signs in they will get their daily follows on screen. This is performed by a script that first identifies today's call backs and then once those calls are made gets those calls that have not been completed. Eventually I would like to add an EventRecord as shown by Matt Petrowsky so I can see who is doing what and when.

So far, regardless of the search the portal refreshes with the proper data and rather quickly. My contacts db is > 15,000 records and searches take approx. 1 second. But, your warning is something that should be heeded and I will attempt to properly document how it works so that, in the future, I will be able to remember what I did, providing Alzheimer's doesn't get me first. ;)

I guess, because I showed you only those graphs related to the Portal Navigation layout and you couldn't look at the file itself you got the impression that my app is basically a flat file. On the contrary, I have 42 tables and two external databases employed. The screen you were looking at relates to 10 different tables. I just employed a lot of tabs because I don't like jumping from screen to screen.

If you note on the top of the screen layout I have two Buttons, "Company Filter" and "Contacts Filter" These employ New Centuries portal filter technique. I use this to quickly find a contact and Jump to a new screen in the event that someone calls in that is not in today's follow ups. I agree with you, it is a rather neat technique. I just couldn't figure out how to join the filter portal with the data screen. I played around with it, but honestly, couldn't get it to work and had no idea where I was going wrong. I think it would be a much stronger and more useful tool, but, I guess I'll have to work with Rays solution for now.

As I always enjoy learning new things and have found your references to such quite enlightening, I will view Matt's video that you so kindly gave me the link to, as soon as possible.

Thanks for all you help and direction.

Al

On the contrary, I have 42 tables and two external databases employed.

And you havn't found the Anchor Buoy approach tempting??

--sd

  • Author

Yes. I had a conversation with Kevin Frank about it. By the time I learned about it I was pretty well on the way to a complete mess. What I have done is as close to an Anchor Bouy version as I could get without dismantling all of my relationships and rebuilding. I think my graph is understandable, at least to me, and I can now at least find my relationships quickly and understand what I have done. I guess I should have done a lot more reading about FM before starting, but, that's how we learn, by our mistakes.

I showed Kevin my original graph and he asked for permission to use it as "What not to do" ;)

I'm looking forward to his update to see how he changed it.

I think my graph is understandable, at least to me, and I can now at least find my relationships quickly and understand what I have done

As long as you're aware that it's defeats the object of getting help, to some extend at least ...expecting someone to think exactly the same thing and roamed the same pastures is far fetched. Thinkgeeks are selling this T-shirt:

will-not-fix.jpg

...intended to all us developers/programmers who had the occational enquiry from our family members, who're stucked in a certain dialogbox they can't make sense of. Since we make our living thru computers and technology have we definately seen all error messages :bang:

I've learned a new term in english today: obfuscated.... while having your problem fresh in my memory, when I pieced this answer together.

--sd

Edited by Guest

  • Author

So, are you saying i am a Procedural Fanatic or an Objects Fanatic, because never the twain shall meet.

Actually, I'm neither. I have no formal programming education. Never took a course. Just tackled it on my own, bought some books and learned what I could. I have programmed in basic, DBase, developed apps in Approach, Access and now FM. I'm a novice at all of them. Perhaps when I retire, I'll take developing applications up as a living ( I love the challenge) and go take some formal courses.

Right now, I am very happy with the way my app is working for my business and have no illusions that it could have been done better and more elegantly. On the other hand for an old fart who's just looking to use the product at hand and make the best of it I don't think I've done so bad. But, as I said I'm old enough to know I don't have all the answers and every year I realize I have fewer and fewer. ;)

But, please never stop pushing me or challenging me to learn more. I love it and appreciate your interest. For if you weren't interested you wouldn't do what you do on this forum.

Al

So, are you saying i am a Procedural Fanatic or an Objects Fanatic, because never the twain shall meet.

Guess which cathegory the "tinkering" type usually lands in?? Who is it that falls in love with neat tricks and cute methods ignoring the "reach" ...because it get's the job at hand done??

Be carefull not to rely entirely on the knocks you gets. E.g. is there a algorithmic difference in how a cat and a dog running along a hedge, seeks a hole to get thru. The dog tries every glimse of light if it should be able to get thru thinking that enough physical strength would make it pass thru. But the cat calculates it's exit by measuring and by knowing what size would sufficient. Similar doesn't it attempt to knock it's environment into behaving...

--sd

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.