ddreese Posted May 25, 2004 Posted May 25, 2004 I have a search layout, when the script goes into find mode and I enter the criteria I want it to then copy that search citeria into global fields, without having to make all the search fields globals themselves, that would be too much work. I have tried to do a 'modify last find', and then 'insert calculated result' from searchfield::firstname to globalfield::firstname. That only works if there is an actual match in the database. Forinstance, if I search for: Last name: Dreese First name: Dan [script runs] g_last name: g_first name: If there is no match in the database, it willnot copy the information to the global fields. Like I said, I realize I could make the search fields on my layout globals, but that would involve a lot of globals and a lot of re-working. There has to be a way! Thanks
ddreese Posted May 25, 2004 Author Posted May 25, 2004 Well, I finally figured it out, only took me 4 hours. goto layout (search layout) enter find mode(pause) modify last find #set find requests to local variables... The relationship1 fields are from our #client master file that holds all their information. The current file does #not hold that information, but it's useful to search by the person's #demographic information set field g_local_firstname = relationship1::firstname set field g_local_lastname = relationship1::lastname set field g_local_ssn = relationship1::ssn set field g_local_dob = relationship1::dob #set the external global variables to the value of the local variables. For #some reason I could not set the relationship1::files directly to the #relationship2::global variables. set field relationship2::g_firstname = g_local_firstname set field relationship2::g_lastname = g_local_lastname set field relationship2::g_ssn = g_local_ssn set field relationship2::g_dob = g_local_dob perform find goto layout (results list) Not sure why it works, but it does.
-Queue- Posted May 25, 2004 Posted May 25, 2004 Most relationships aren't valid when in Find Mode. As discussed recently in another thread here, globals can be passed using any relationship, whether valid or invalid. Actual data, however, cannot. This is why you can't set rel1::field to rel2::global. I'm curious how your rel1 is defined, though, since you were able to set local globals based on it. It would probably be more foolproof to add each global to the layout, hide them, and format them to not allow entry. Then you could easily Copy[field] and Paste[global] without using relationships that may fail. This is also why it's better to use globals to hold the find criteria in the first place.
Recommended Posts
This topic is 7486 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