TDavidson Posted July 9, 2009 Posted July 9, 2009 Hi, I would like to create a script that would perform a find whose criteria would be was is currently in a given field on the current record. Is this possible? Thanks.
Lee Smith Posted July 9, 2009 Posted July 9, 2009 Something like; Freeze Window Set Variable [ $Find; YourFindField ] Enter Find Mode [ ] Set Field [ YourFindField; $Find ] Perform Find [ ] HTH Lee
mr_vodka Posted July 9, 2009 Posted July 9, 2009 BTW you dont really need a script for this. You can just select the field that you want, right click and then choose 'Find MAtching Records'
TDavidson Posted July 9, 2009 Author Posted July 9, 2009 It keeps telling me that ''No records match this set of find requests'' but this can't be true because if I go to find mode myself and type in a value, it finds the corresponding records. Any ideas? Thanks.
TDavidson Posted July 9, 2009 Author Posted July 9, 2009 Here it is. The reason I can't simply right-click and select "Find matching records" is because I want the search to be performed on another layout. Freeze Window Set Variable [$Find; Value:equipment_list::el_equip_name] Go to Layout ["Inspection Issues" (inspection_issues)] Enter Find Mode [] Set Field [equipment_list::el_equip_name; "$Find"] Perform Find [] Thanks.
Lee Smith Posted July 9, 2009 Posted July 9, 2009 (edited) Maybe it's my tired eyes, but I don't see an error. Why not use Script Debuger step through your script to see what is isn't doing. Lee [color:red]p.s. You can also post a copy of your file here if you want Before you do, remove any confidential information, or post a no record clone. Edited July 9, 2009 by Guest p.s.
comment Posted July 9, 2009 Posted July 9, 2009 Are you sure about this: Freeze Window Set Variable [$Find; Value:equipment_list::el_equip_name] Go to Layout ["Inspection Issues" (inspection_issues)] Enter Find Mode [] Set Field [[color:red]equipment_list::el_equip_name; "$Find"] Perform Find []
bcooney Posted July 9, 2009 Posted July 9, 2009 You've switched to a new layout and new context, but the field that you reference is in the old context.
mr_vodka Posted July 9, 2009 Posted July 9, 2009 Also... Set Field [equipment_list::el_equip_name; [color:red]"$Find"] Get rid of the quotes.
mr_vodka Posted July 9, 2009 Posted July 9, 2009 What Barbara was trying to point out was that your script goes to a layout based on inspection_issues but you are searching for a value in the equipment_list table. Unless they are somehow related, you will not return the results that you want.
Lee Smith Posted July 9, 2009 Posted July 9, 2009 Nice catch John, I knew there was something that my eyes were not seeing. Hey [color:red]TDavidson, when you use a variable, it is like using a field, and you don't need to enclose it in quotes, i.e. just $Find, not "$Find". I think that your File Structure needs to be explained. If the two layout are two different Files, or TOs, you need to have a relationship in order for the script return anything. If on the other hand, they are both layouts in one TO, then you don't even have to change layouts, because the Set Field Script Step doesn't require the Field to be on the current layout, and you could then move the Go To Layout to after the Find has been performed. HTH Lee
TDavidson Posted July 10, 2009 Author Posted July 10, 2009 I got rid of the quotes and it now works fine. There is a relationship between both table occurences so that shouldn't be a problem. Thank you so much for your help guys!
Recommended Posts
This topic is 5616 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