Jump to content
Server Maintenance This Week. ×

GetNthRecord HELP!


aldipalo

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

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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