onno Posted July 29, 2002 Posted July 29, 2002 in my main file there is a portal showing corresponding invoices in a related file. I would like to find the records that do not have (a) related invoice(s). I understand that it is impossible to perform a "zero records" find (result no records found). What should I do. Thank you for your help.
djgogi Posted July 29, 2002 Posted July 29, 2002 Hi, try this one: 1. define in your main file an "constZero" field with option auto enter data 0 (you'll need to perform replace for already existing records). 2. allways in main define an calc field result number say hasInvoice as hasInvoice=Count(relName::invoiceID) where relName is your relationship used for displaying invoices in portal. 3. finally define an relationship in main NoInvoices::hasInvoice-->constZero 4. create an script set error capture on GTRR [noInvoices, show only related] //handle no related records HTH Dj
djgogi Posted July 29, 2002 Posted July 29, 2002 ooops, I was writting without thinking. So of course last step won't work. Instead you'll have to perform find ( in main) on hasInvoice=0 (BTW it's an unindexed field so the search might yield some time if large number of records is involved). Than also you don't need neither step 1 and step 3. sorry Dj
onno Posted July 29, 2002 Author Posted July 29, 2002 Yep, it works. I have tried to do what you explained in your first reply but I soon found out that just creating the calc field hasInvoice=count(relName::invoiceID) would do the trick. Thanks a lot!
Recommended Posts
This topic is 8155 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