Jump to content

Value list from found set


DanBrill
 Share

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

Recommended Posts

Thanks Ugo! You always seem to have an answer. Since you introduced me to the 'Value List Items' function I've found a number of ways to use it. If the Bush administration was currently letting us say anything nice about anything French, I'd say you were a great guy. wink.gif

Dan

Link to comment
Share on other sites

Thanks Dan smile.gif

Actually, I have that chance to be an Italo-French citizen, but I feel French people are nice too. Actually, my wife and my kids, borned here are Frenchies.. crazy.gif

Now this solution is not that far from what you recommanded last day about having a value list stay in the first record of the file.

In this one, it stays in the first record of the foundset, that's all.

You could get it as dynamic has to have a number in a value list (this time re-using that sample file I made for Macaroni) of numbers. Hitting a specific num would bring you to this number in the foundset.

More than the VLI here (which is used for referencing records in foundset), the CopyAllRecords is what can make it work.

Link to comment
Share on other sites

Congrats Queue! I just broke 200 today to become an enthusiast.

I took a look at your solution Ugo. Very ingenious. I say this because it is very close to what I had come up with. wink.gif In my solution to the problem I used a loop with a Set Field command to search the found set and add new values to a multi-line global variable. (It didn't really matter that it was a global variable since I wasn't really using it as a value list, and so didn't need to be indexable. I just thought that the VLI might be a good way of creating a list without duplicates. My loop method removed the need for it.)

But now my question is, is there an advantage of using the copy-paste method over the loop method? I've never tried the copy-paste method of creating a multi-line text field. It seems like it might be faster.

Which method will work better in multi-user settings?

Thanks,

Dan

Link to comment
Share on other sites

Copy All Records has the definitive advantage on a Multi-user environment, as it will suceed even with locked records, while a loop will fail.

It's quicker too. Its drawback, the text limits in a field. But it still allows for 64k.

Well, there are some workarounds. I had to use one once, so there it is.

When ending with your foundset, checks its number. If the CopyAllRecords would fail to capture the whole set, then use 1 global repeating field, and split it in 2 sets.

One calc is needed though

c_SecondSet = Case(not Patterncount(:(:RelatedFile:g_Ids,Record_ID), Record_ID,"")

SetField[g_Break, Status(CurrentFoundCount)/2)]

GoToRecord[by field value - g_Break]

OmitNext[1,000000-no dialog]

GoToLayout[blankwithID]

CopyAllRecords

GoToLayout[blankwithg_IDS]

GoToFiedl[g_IDS-1-select]

Paste

Show Omitted

GoToLayout[blankwith c_secondset]

CopyAllRecords

GoToLayout[blankwithg_IDS]

GoToFiedl[g_IDS-2-select]

Paste

Store in another set of global the number of Ids per global repetition.

So now you'd move through your referenced foundset by switching to the next repetition when you've reached the last ID in the first one.

Link to comment
Share on other sites

Dan,

You could also of course harness the binary ID total solution (as in my portal for found records) as a way to have a self-join relation to exactly the current found set. A value list could be generated via that relation. That trick shoudn't have any trouble with multi-users, and doesn't require any scripting, but does require generating quite a few calc fields on the front end, depending on the anticipated size of your database... crazy.gif

I haven't tried to generate a value list from it, but it ought to work...

FoundSet Self Join

Link to comment
Share on other sites

Thanks for all the help guys. In the end I combined the copy all records approach with a Value List Items calc.

Here's a little more background on what I've got going. I have a list of members of organizations and their e-mail addresses. I want to send a bulk e-mail to org members in the found set. But people can be members of more than one organization, so their name and e-mail can appear twice in the list. But I don't wan't to send them multiple e-mails, and so I can't use the mail option that uses all the addresses from the found set. What I need is a list of unique e-mail addresses from the found set. It also can't have any blanks, and being in alphabetical order is a plus.

So, I switch to a layout with only the e-mail address field, copy all of the e-mail addresses, switch back to the original layout and paste them into to a regular text field. (It has to be on the layout for the paste to work, but I don't want the user to see it. So I have this set to be 1 px by 1 px, no border, no entry, same color as the background. In a nutshell, invisible to the user.) It ends up populating the field of whatever record you are on when you launch the script. I then create a value list from this field, using only the related records from a self join on the records unique id. (Thereby avoiding multi-user problems). Finally, a calc field of Value List Items is created from that value list, and I can send the mail to the found set. (The probablility of the list being over 64k is pretty small, so I won't worry about that for the moment.)

This would also be a good way of producing a multi-key for the left hand side of a relationship, and will work quickly and well in a multi-user setting.

Thanks again for all of the good ideas,

Dan

Link to comment
Share on other sites

Thanks for the applause, guys. grin.gif But I'm curious why I'm still just a 'member' when Dan's been promoted to 'enthusiast'. Was it something I said? shocked.gif

And congrats to you, too, Dan! I think you're well on your way to catching up with me at the rate you're going. wink.gif

Link to comment
Share on other sites

It may be the rate at which I've been posting lately. I'm in a phase of the job that's requiring a lot of FM time, and its also been requiring me to stretch my brain more than a little bit. So I come here for help, and I seem to come often. Also, after a year of using FM now, I can actually answer a question from time to time too, so I do what I can to help out. Sorta a FileMaker karma thing -- I've been helped so much by people like you, Ugo, Lee, LaRetta, Vaughn, CoboltSky, Fenton, ESpringer, Christian, John, Anatoli, and many, many others -- that I try to help as much as possible. It keeps the community running. And the more I'm here, the more I learn, and the better my solution gets.

Or, it could be that your enthusiasm detector chip is sensing that you aren't really that enthused. wink.gif

Thanks for everything guys.

Link to comment
Share on other sites

This topic is 6589 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
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.