PTKen Posted January 30, 2003 Posted January 30, 2003 Hi all! I've been searching here for an answer, but there is so much good information that I keep getting side tracked and haven't found anything specifically on this topic yet, so sorry if it's a repeat... Scenario: Two files, "Clients" and "Jobs". "Clients" has two fields - "Client_Name" and "PK_Clients" (the primary key). Both fields require unique values. "Clients" has a value list which uses values from the field "Client_Name". In my format file, I have a popup menu that uses the value list for selection. This all works fine so far. What I want to do but can't figure out, is how do I make a selection from the value list and then search the file "Jobs" for records that have the corresponding Primary Key? I guess what I can't figure out is how to use the client name (from the value list) in the popupmenu, but then search using the primary key instead. When I search with the client name, even though it's unique, a value of "a" will find "a", but also "ab", "abc", etc. Thanks. Ken
Ugo DI LUCA Posted January 30, 2003 Posted January 30, 2003 Edited I realized that you posted this question in the CDML Forum afterwards. Do not know anything abaout it. Hope this could be possible anyway. Well, if you don't mind showing the Primary Key, you could have the list show both Client Name and PK_ID. You could have the list sorted from the Client Name show ID6 ALBERT, ID7 BOB. Then, change your relationship from Name::Name to PK_ID::PK_ID. and set the field "ClientName" to be a lookup from this relationship. Then, you do not need to do a find in Jobs. Just create a Portal that will display the Jobs for that Client_ID. You could use the raws from this portal as a button (with script) to go to the related record in this file. Check the menu for define value list and look to this option. Then use the PK as the relat
PTKen Posted January 30, 2003 Author Posted January 30, 2003 Thanks for the input, but I really don't think showing the key is appropiate. I'm using the 20 character key as described in the article on this forum and it's not something the user should see. Ken
Ugo DI LUCA Posted January 30, 2003 Posted January 30, 2003 OK then, why not having a portal to show all clients using a a constant (stored calculation constant = 1), then select the client from the portal. Or see sample section for Type-Ahead portal (not because I posted it ...).
Unable Posted January 30, 2003 Posted January 30, 2003 "When I search with the client name, even though it's unique, a value of "a" will find "a", but also "ab", "abc", etc." You could use a "Field Content Match". That has been covered quite extensively on this forum. Search the term "exact search".
Garry Claridge Posted January 30, 2003 Posted January 30, 2003 Because, "Clients" has unique values you do not need to use a ValueList. You could just use a -findall with a -sortfield on client_name. The select list pop-up would look like this: <select name="pk_clients"> <option value="">Select a Client</option> [FMP-Record] <option value="[FMP-Field:pk_clients]">[FMP-Field:client_name]</option> [/FMP-Record] Hope this helps. All the best. Garry
Recommended Posts
This topic is 8119 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