Frink1234 Posted February 8, 2007 Posted February 8, 2007 I have a database with 15,000 names. When I want to add data to one client I run a find request entering a few letters in the last name field and a few letters in the first name field. With so many names, I have several clients that have the same first and last name. What I would like, is a script calculation that would run when I do the find to make visible a container field with a graphic that says something to the effect "Caution - Client with same name exists".
mr_vodka Posted February 8, 2007 Posted February 8, 2007 You dont really need a script for this per se. You can just have a stored calculation field or text calculated value) used with a self join and then a calculation field with container result. gCautionImage - global container that stores your image. cNameFull (NameLast & "_" NameFirst) Self Join Relationship Based off cNameFull Then your container calc could just be: cDisplayCaution ( Case ( count ( SJ::cNameFull) > 1; gCautionImage)
Frink1234 Posted February 8, 2007 Author Posted February 8, 2007 (edited) Hmmm, I see what you are saying, I just can't seem to get it to work. I must need some clarification. gCautionImage - global container that stores your image. <===Done, No problem here cNameFull (NameLast & "_" NameFirst)<=== OK, I have this field Self Join Relationship Based off cNameFull <===New table occurrence, done Then I made a calc field (result is container)called cDisplayCaution in my main table and inserted the calculation Case ( count ( SJ::cNameFull) > 1; gCautionImage) This doesn't work. EDITED POST: OK, I just changed the calc field cDisplayCaution to this: If ( Get ( FoundCount )> 1; gCautionContainer) and that works without having to use a self-join. Your solution may be more elegant and offer me more but I could not get it to work. Edited February 8, 2007 by Guest
John Mark Osborne Posted February 8, 2007 Posted February 8, 2007 This example file may help you figure what's going wrong. There are several examples for duplicate checking and one of them uses the same basic technique outlined by mr_vodka. http://www.filemakerpros.com/Duplicatesv7.zip
mr_vodka Posted February 8, 2007 Posted February 8, 2007 OK, I just changed the calc field cDisplayCaution to this: If ( Get ( FoundCount )> 1; gCautionContainer) and that works without having to use a self-join. Your solution may be more elegant and offer me more but I could not get it to work. That wont work. All that does is checks to see if the found count is greater than 1. So anytime that the found set it more than 1, it will display. Take a look at the sample. Frink.zip
Frink1234 Posted February 8, 2007 Author Posted February 8, 2007 OK, thanks for the example. That should make it much easier for me to see what I was doing wrong. I'll report back here after I get a chance to put it to work into my database. Glad to see you caution flagged the right record in your example .
Frink1234 Posted February 8, 2007 Author Posted February 8, 2007 :yay: Yep, I see what I was doing wrong. This is just what I need. Have a Grey Goose on me!
Recommended Posts
This topic is 6499 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 accountSign in
Already have an account? Sign in here.
Sign In Now