Ron Cates Posted September 30, 2010 Posted September 30, 2010 This one has me stumped. I will do my best to explain. I have a simple find in a script. This find works fine Enter Find Mode [ ] Set Field [ Departments:_pk_department_id; Build_Sets::xdep ] Perform Find [ ] When I add the second criteria it pops up a find in progress dialog and never comes out of it. Enter Find Mode [ ] Set Field [ Departments::_pk_department_id; Build_Sets::xdep ] [color:blue]Set Field [ Leads::status; "=" ] Perform Find [ ] As a test I changed the first criteria. And this find works fine. (but it's not the find I want) Enter Find Mode [ ] [color:blue]Set Field [ Leads::_fk_dep_id; Build_Sets::xdep ] Set Field [ Leads::status; "=" ] Perform Find [ ] Somehow it seems that the two criteria [color:blue]Set Field [ Departments::_pk_department_id; Build_Sets::xdep ] and [color:blue]Set Field [ Leads::status; "=" ] Both work in different finds but when I use them both together in a find it hangs forever. Are there any limitations to finding through relationships in different directions or too far away or anything of that nature that might explain this? Please understand, it would take far to long to strip down my file in order to post it. However I will work on a breaking out the relevant TOs in my graph to show the structure and relationships. Thanks
Ron Cates Posted September 30, 2010 Author Posted September 30, 2010 Here is a stripped down version of my relationship graph. The finds are being done from a layout based on the Leads_Sets join table.
bcooney Posted September 30, 2010 Posted September 30, 2010 Hi Ron, You haven't included the Build_Sets TO in your graphic. Apparently, you're finding in one table based on a value in another?
Ron Cates Posted September 30, 2010 Author Posted September 30, 2010 Build_Sets::xdep is a global field from a table that contains only global fields.
Fenton Posted September 30, 2010 Posted September 30, 2010 There are two limitations about Finds with relationships. 1. You cannot get data from fields (except global fields) when you're in Find mode. In which case you need to preset the data you want to use into globals or script Variables BEFORE you enter Find mode. (Your xdep is likely a global field, so you can ignore this, but I'll proceed as if it wasn't.) 2. You cannot Find for "=" (empty) via a relationship. Because it just doesn't work. The way you Find for empty via relationships is to Find for "*" (anything), then Omit. To Find with 2 criteria like you're doing, pseudo code: Set Variable [ $data; relationship0::field0 ] Enter Find Mode Set Field [ relationship1::field1; $data ] New Record/Request Set Field [ relationship2::field2; "*" ] Omit Record Perform Find Alternatively you could do the 1st Find, then re-enter Find mode, set up the 2nd criteria, then Constrain Find. Yes, more trouble. But in many cases a (much) faster result, as the 2nd find is "within" the 1st's found set.
Ron Cates Posted September 30, 2010 Author Posted September 30, 2010 I used the constrain found set suggestion and everything is working fine. I was not aware that finding for "=" via a relationship was an issue. I will remember that. Thanks Fenton.
Recommended Posts
This topic is 5167 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