fishbone Posted March 16, 2005 Author Posted March 16, 2005 OK, so I am probably making this harder than it should be, but here is the scenario. I have a button called, "affiliate": when you click this button it is supposed to search all the records within the table for all exact matches of the affiliate under the "affialates" field. For example, I am on record #33526 and the affiliates field is eg. "Pizza Hut" (The one in your hometown for an address). When I click the affiliate button, i want to do a find for all the "Pizza Huts" in my database and return them in a table view? How do i do this? I am using a script "perform find" but my criteria is wrong? Please help Thanks
fishbone Posted March 16, 2005 Posted March 16, 2005 OK, so I am probably making this harder than it should be, but here is the scenario. I have a button called, "affiliate": when you click this button it is supposed to search all the records within the table for all exact matches of the affiliate under the "affialates" field. For example, I am on record #33526 and the affiliates field is eg. "Pizza Hut" (The one in your hometown for an address). When I click the affiliate button, i want to do a find for all the "Pizza Huts" in my database and return them in a table view? How do i do this? I am using a script "perform find" but my criteria is wrong? Please help Thanks
fishbone Posted March 16, 2005 Author Posted March 16, 2005 OK, so I am probably making this harder than it should be, but here is the scenario. I have a button called, "affiliate": when you click this button it is supposed to search all the records within the table for all exact matches of the affiliate under the "affialates" field. For example, I am on record #33526 and the affiliates field is eg. "Pizza Hut" (The one in your hometown for an address). When I click the affiliate button, i want to do a find for all the "Pizza Huts" in my database and return them in a table view? How do i do this? I am using a script "perform find" but my criteria is wrong? Please help Thanks
dwins Posted March 16, 2005 Posted March 16, 2005 Copy [affiliates] Enter Find Mode Insert Text [affiliates =] Paste [affiliates] Perfom Find Note the addition of the inserted "="
dwins Posted March 16, 2005 Posted March 16, 2005 Copy [affiliates] Enter Find Mode Insert Text [affiliates =] Paste [affiliates] Perfom Find Note the addition of the inserted "="
dwins Posted March 16, 2005 Posted March 16, 2005 Copy [affiliates] Enter Find Mode Insert Text [affiliates =] Paste [affiliates] Perfom Find Note the addition of the inserted "="
fishbone Posted March 16, 2005 Author Posted March 16, 2005 thank you dwins, i tried it out and it works about 90% the way i want it too. I need an exact match... with what you gave me i tested it using "hilo" in a few records and "hilooo" in a record and when i clicked the button to perform the script both "hilo" and "hiloo" showed up....can i do an exact match this way or no?
fishbone Posted March 16, 2005 Author Posted March 16, 2005 thank you dwins, i tried it out and it works about 90% the way i want it too. I need an exact match... with what you gave me i tested it using "hilo" in a few records and "hilooo" in a record and when i clicked the button to perform the script both "hilo" and "hiloo" showed up....can i do an exact match this way or no?
fishbone Posted March 16, 2005 Author Posted March 16, 2005 thank you dwins, i tried it out and it works about 90% the way i want it too. I need an exact match... with what you gave me i tested it using "hilo" in a few records and "hilooo" in a record and when i clicked the button to perform the script both "hilo" and "hiloo" showed up....can i do an exact match this way or no?
Vaughan Posted March 16, 2005 Posted March 16, 2005 Copy and Paste are layout dependent (the fields must be on the current layout when the script is performed) and using them like this destroys the contents of the clipboard (of which the user took trouble to put there). There are ways to save the clipboard, but nothing beats avoiding the problem altogether! This soultion requires a global field to store the search criteria... gAffiliates: Set Field [ gAffiliates ; affiliates ] Enter Find Mode [] Set Field [ affiliates ; "==" & gAffiliates ] Perform Find [] Note that the "==" prepended to the search criteria forces an exact field content match. Set Field only works if the calculated string is valis for the field's data type, so it won't work for dates because ">1/1/2005" is not a valid date. In this case the Insert Calculated Text step will do the job, but this is layout dependent. In this case the script would be... Freeze Window Set Field [ gAffiliates ; affiliates ] Enter Find Mode [] Go to Layout [ <layout with field on it> ] Insert Calculated Result [ affiliates ; "==" & gAffiliates ] Go to Layout [ original layout ] Perform Find []
Vaughan Posted March 16, 2005 Posted March 16, 2005 Copy and Paste are layout dependent (the fields must be on the current layout when the script is performed) and using them like this destroys the contents of the clipboard (of which the user took trouble to put there). There are ways to save the clipboard, but nothing beats avoiding the problem altogether! This soultion requires a global field to store the search criteria... gAffiliates: Set Field [ gAffiliates ; affiliates ] Enter Find Mode [] Set Field [ affiliates ; "==" & gAffiliates ] Perform Find [] Note that the "==" prepended to the search criteria forces an exact field content match. Set Field only works if the calculated string is valis for the field's data type, so it won't work for dates because ">1/1/2005" is not a valid date. In this case the Insert Calculated Text step will do the job, but this is layout dependent. In this case the script would be... Freeze Window Set Field [ gAffiliates ; affiliates ] Enter Find Mode [] Go to Layout [ <layout with field on it> ] Insert Calculated Result [ affiliates ; "==" & gAffiliates ] Go to Layout [ original layout ] Perform Find []
Vaughan Posted March 16, 2005 Posted March 16, 2005 Copy and Paste are layout dependent (the fields must be on the current layout when the script is performed) and using them like this destroys the contents of the clipboard (of which the user took trouble to put there). There are ways to save the clipboard, but nothing beats avoiding the problem altogether! This soultion requires a global field to store the search criteria... gAffiliates: Set Field [ gAffiliates ; affiliates ] Enter Find Mode [] Set Field [ affiliates ; "==" & gAffiliates ] Perform Find [] Note that the "==" prepended to the search criteria forces an exact field content match. Set Field only works if the calculated string is valis for the field's data type, so it won't work for dates because ">1/1/2005" is not a valid date. In this case the Insert Calculated Text step will do the job, but this is layout dependent. In this case the script would be... Freeze Window Set Field [ gAffiliates ; affiliates ] Enter Find Mode [] Go to Layout [ <layout with field on it> ] Insert Calculated Result [ affiliates ; "==" & gAffiliates ] Go to Layout [ original layout ] Perform Find []
stanley Posted March 16, 2005 Posted March 16, 2005 ... along Vaugan's lines, there is nothing like putting a "variable" global field of each type (text, number, date, container) in a database (or table, in the FMP7 lingo) in advance, to use for these types of situations. The situations arise more often than expected, and the fields are always useful. The bonus is that they do not take up much space if not used, and if they are not used, they are easily removed from the system... -Stanley
stanley Posted March 16, 2005 Posted March 16, 2005 ... along Vaugan's lines, there is nothing like putting a "variable" global field of each type (text, number, date, container) in a database (or table, in the FMP7 lingo) in advance, to use for these types of situations. The situations arise more often than expected, and the fields are always useful. The bonus is that they do not take up much space if not used, and if they are not used, they are easily removed from the system... -Stanley
stanley Posted March 16, 2005 Posted March 16, 2005 ... along Vaugan's lines, there is nothing like putting a "variable" global field of each type (text, number, date, container) in a database (or table, in the FMP7 lingo) in advance, to use for these types of situations. The situations arise more often than expected, and the fields are always useful. The bonus is that they do not take up much space if not used, and if they are not used, they are easily removed from the system... -Stanley
comment Posted March 16, 2005 Posted March 16, 2005 In version 7, you can: Enter Find Mode [ ] Set Field [ Table::Datefield; ">1/1/2005" ]
comment Posted March 16, 2005 Posted March 16, 2005 In version 7, you can: Enter Find Mode [ ] Set Field [ Table::Datefield; ">1/1/2005" ]
comment Posted March 16, 2005 Posted March 16, 2005 In version 7, you can: Enter Find Mode [ ] Set Field [ Table::Datefield; ">1/1/2005" ]
fishbone Posted March 17, 2005 Author Posted March 17, 2005 how do i do this? i cant get this to happen? Set Field [ gAffiliates ; affiliates ] I cant use the semi-colon in there?
fishbone Posted March 17, 2005 Author Posted March 17, 2005 how do i do this? i cant get this to happen? Set Field [ gAffiliates ; affiliates ] I cant use the semi-colon in there?
fishbone Posted March 17, 2005 Author Posted March 17, 2005 how do i do this? i cant get this to happen? Set Field [ gAffiliates ; affiliates ] I cant use the semi-colon in there?
comment Posted March 17, 2005 Posted March 17, 2005 In ScriptMaker, select the Set Field step. There are two buttons at the lower right corner. Click on the top one, and select the target field. Click on the bottom one and enter a calculated result - this will put into the target field. When you're done, the Set Field step will reflect your choices. It will look like: Set Field [Table::Targetfield; Calculation].
comment Posted March 17, 2005 Posted March 17, 2005 In ScriptMaker, select the Set Field step. There are two buttons at the lower right corner. Click on the top one, and select the target field. Click on the bottom one and enter a calculated result - this will put into the target field. When you're done, the Set Field step will reflect your choices. It will look like: Set Field [Table::Targetfield; Calculation].
comment Posted March 17, 2005 Posted March 17, 2005 In ScriptMaker, select the Set Field step. There are two buttons at the lower right corner. Click on the top one, and select the target field. Click on the bottom one and enter a calculated result - this will put into the target field. When you're done, the Set Field step will reflect your choices. It will look like: Set Field [Table::Targetfield; Calculation].
Recommended Posts
This topic is 7570 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