Mike Summer Posted January 23, 2006 Posted January 23, 2006 I am a new member struggling with the following problem. I want to search on two fields and I’m using the ‘constrain found’ set to do this. However it is not working. Can you help? The script is as follows. Enter Find Mode[] Set Field [Customer::User;Get(Accountname)] Perform Find [] Constrain Found Set [] Enter Find Mode [] Set Field [Customer::DateCreated; Get(CurrentDate)] Perform Find [] The above script returns the records by CurrentDate, but not CurrentDate and User. I would appreciate your thoughts.
Ted S Posted January 23, 2006 Posted January 23, 2006 How about this: Enter Find Mode[] Set Field [Customer::User;Get(Accountname)] Set Field [Customer::DateCreated; Get(CurrentDate)] Perform Find []
ssimons Posted January 23, 2006 Posted January 23, 2006 (edited) Why not try setting both fields before performing the find. Enter Find Mode Set Field [Customer::User; Get(Accountname)] Set Field [Customer::DateCreated; Get(CurrentDate)] Perform Find Edited January 23, 2006 by Guest Sorry, I think Ted and I were replying at the same time.
mr_vodka Posted January 23, 2006 Posted January 23, 2006 Try it like this: Enter Find Mode[] Set Field [Customer::User;Get(Accountname)] Set Field [Customer::DateCreated; Get(CurrentDate)] Perform Find []
comment Posted January 23, 2006 Posted January 23, 2006 Just to explain why your version didn't work, it should be: Enter Find Mode[] Set Field [Customer::User;Get(Accountname)] Perform Find [] Enter Find Mode [] Set Field [Customer::DateCreated; Get(CurrentDate)] Constrain Found Set [] IOW, Constrain Found Set [] comes INSTEAD OF Perform Find [].
Mike Summer Posted January 24, 2006 Author Posted January 24, 2006 Thanks. It worked fine. I think I overcomplicated it, thinking I had to constrain a found set first and then do another find on that set.
Mike Summer Posted January 24, 2006 Author Posted January 24, 2006 Thanks. It worked fine. I think I overcomplicated it, thinking I had to constrain a found set first and then do another find on that set.
Mike Summer Posted January 24, 2006 Author Posted January 24, 2006 Thanks. I was looking for an explanation of why this did not work - the constrain found set[] replaces perform find []. Just one more question. It appears to make more sense to put the constrain found set [] after the first find, rather than at the end of the second find, does it not? My logic was to constrain on the first find and then do a second find on the constrained set.
comment Posted January 24, 2006 Posted January 24, 2006 The first find does Perform Find[], which REPLACES the current found set. The second one does Constrain Found Set, which REDUCES the (new) current found set. Each one needs to have search criteria BEFORE it can do anything.
Recommended Posts
This topic is 6880 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