Pek Posted July 3, 2004 Posted July 3, 2004 Building a db for my girlfriend who runs a cleaning company. Set up a simple client contact db (clientContacts) with a portal that lets a client have more than one cleaning address (CareProperties , address what needs doing etc) . Each client has a unique number . Each cleaning address had a unique number (House Id) displayed in portal. Made a relationship between the two Added a button to the portal to goto the related record in careproperties. This works fine though if someone does have more than one it finds both records. I understand why as both are related. What I need to do is only goto the file via HouseId . I think my rough script wants to be get the HouseId for this row goto that record in Careproperties tried to use a find in the script but I would have to manualy enter the Id number, could nt work out how to get it automaticaly thanks in advance Ric
Fenton Posted July 3, 2004 Posted July 3, 2004 If you see both in the portal, and have a button in the portal row to Go To Related Record [show, "Portal's relationship"], then it will indeed "find" all the records which are in the portal; but it will land on the particular one you clicked into. You may have left out the "Show only related records" option. If the above doesn't work, it would be because something's wrong about the relationship. It should be between ClientID in Clients and ClientID in CareProperties. The unique HouseID is correct, but it has no bearing really on this problem, nor should it be involved in the relationship. The ClientID=::ClientID portal to Properties knows which record belongs to what row (a redundant statement, the records are the rows), even without such an ID.
Pek Posted July 3, 2004 Author Posted July 3, 2004 thanks . That works , not sure what I was doing wrong though. When I tried before it would find both files but always show the first one. I did come up with this script in the end goto related record [show, careproperties] perform script[ sub scripts, external: careproperties] *careproperties* goto layout [housedetails] enter find mode [restore] insert from last record [select, "houseId"] perform find [constrain found set] which seems to work but is a lot slower. I did have the relationship set up right , was seperate to HouseId. I just thought I needed to search by House Id as it were. Thanks again for explaining slowly it all sinks in Ric
Fenton Posted July 3, 2004 Posted July 3, 2004 You need to explain more carefully. Everything after Go To Layout ["houseDetails"] is not necessary, probably incorrect. Go To Related Record [""] very seldom needs a Find after it. If you are not: 1. In a found set of properties for that 1 Client 2. On the specific property that you clicked on in the portal in Clients Then something's wrong. It's really a 1-step process; with Go To Layout [""] for frills. This is a basic relational operation, the most basic in FileMaker. It will be well worth your while to really understand it.
ESpringer Posted July 3, 2004 Posted July 3, 2004 It seems Ric is unhappy that the found set includes more than the one record for the portal row that is clicked (even though others are for same relation). ... Is that right? If so, Ric, *why* do you care whether other properties for this client are in the found set if the right one is showing on top? Perhaps simply putting the record in Form view (rather than list view) would help? Or, perhaps you aren't aware that you can print just the current record? At any rate, all of my dbs include a script called "IsolateRecord". The steps are Show All Records, Omit Record, Show Omitted. This script can be invoked any time you want to have the found set limited to the current record.
Fenton Posted July 3, 2004 Posted July 3, 2004 Yes, that's true, if you only want 1 record, then additional steps are needed. Another way to do that is to set a global field to the specific unique ID of the Property (as you said, they have one; and I said it didn't matter; well, now it does :-). Create a relationship between the global and the unique PropertyID. Exit Record/Request Go To Related Record [show, "global=::ID relationship"] It's been pointed out by the wise (Ilyse Kazar, Jimmy Jones) that the Show, Omit, Show Omitted method, while good, is not foolproof in a multi-user environment. Because if a record is created by someone else in that split second that your record is the omitted set, their record will join yours, respecting your found set. Then Show Omitted will show 2. I know, not very (or at all) likely; but the Go To Related Record [show,"unique ID"] doesn't have that weakness.
Pek Posted July 3, 2004 Author Posted July 3, 2004 Thanks again Fenton your first surgestion worked fine. I did try that way originaly but as I say it would find both records and always show the first one listed in the portal. I must have typed something wrong ) "It seems Ric is unhappy that the found set includes more than the one record for the portal row that is clicked (even though others are for same relation). ... Is that right?" yeap "If so, Ric, *why* do you care whether other properties for this client are in the found set if the right one is showing on top? Perhaps simply putting the record in Form view (rather than list view) would help? Or, perhaps you aren't aware that you can print just the current record?" ESpringer.. oh theres a lot I'm not aware of ) I care just because it would show the first record not always the right one. The portal shows just the address and Id number. The record and layout it takes you to lets you enter a lot more details for that property : what rooms, surfaces , special instructions , a lot of info. From there (hopefully) be able to print off quality control worksheets, equipment and products needed. Thank you both for setting me straight after I got sidetracked Ric
ESpringer Posted July 15, 2004 Posted July 15, 2004 Fenton, Thanks for pointing out the problem with ShowAll-Omit-ShowOmitted in a multi-user environment. I've been spoiled by my single-user situation.
Recommended Posts
This topic is 7439 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