setting a filter

hi, I have the opportunity table and on that table there are 2 fields : ContactCompanyNo and Bill-To-ContactCompanyNo. Now i want to filter the opportunity table so that i only get the records where ContactCompanyNo = Contact.CompanyNo and Bill-To-ContactCompanyNo = Contact.CompanyNo. The problem is when in the table opportunity the ContactCompanyNo is filled in then the Bill-To-ContactCompanyNo is blank and vice versa Best regards, Wendy

hi which version of attain r u using. Harikesh

Set filter/range “ContactCompanyNo = Contact.CompanyNo”, then read; AfterGetRecord test for the other condition; if false, skip and read next record.

hi, @ Harikesh : i’m using version 3.60 @ Anfinnur : if i set the range “ContactCompanyNo = Contact.CompanyNo” first then in OnAfterGetRecord it will only have the records who are filtered with the first range, so if i then filter on the other condition he will never find any records or am i thinking wrong Wendy,

No, you are not thinking wrong - I made my reply in a hurry, sorry! Navision (3.60 or older) does not handle “combined filters”. With SETRANGE/FILTER you cannot filter out “Field1==Condition OR Field2==Condition” like in e.g. Oracle. You have to read record by record and check it by IF-THEN-ELSE.

You can either use Marked Records… 1) Find all records where ContactCompanyNo = Contact.CompanyNo - Mark Them 2) Find all records where Bill-To-ContactCompanyNo = Contact.CompanyNo - Mark Them 3) View All Marked Records. Or Create a new field on the Opportunity Table which contains the CompanyNo field (Populated based on the VALIDATE Triggers of the other 2 fields)