Avoiding OnLookup trigger from report request form

---------------------------------------- Firm Type - OnLookup() Fee.SETRANGE(FeeType, Fee.FeeType::Firm); IF “Firm Type” <> ‘’ THEN BEGIN Fee.FeeType := Fee.FeeType::Firm; Fee.Code := “Firm Type”; Fee.FIND; END; IF FORM.RUNMODAL(FORM::“Firm Fees”,Fee) = ACTION::LookupOK THEN VALIDATE(“Firm Type”, Fee.Code); ---------------------------------------------------------------- Firm Type - OnValidate() IF “Firm Type” <> ‘’ THEN TESTFIELD(Member, TRUE); -------------------------- The above code can be found on a table called the Firm table, which is fine. A DataItem of a report is the Firm table, and one of the ReqFilterFields is this “Firm Type” field. An error occurs when the lookup is used on the report because it is checking whether the firm record has Member = Yes, even though the record has not actually been initialised. I want to know how to avoid the error. Is there anyway to tell that the OnLookup trigger is being called from a report request form? I have tried using CurrFieldNo in the OnLookup trigger, but the value is still the field no. value, not zero as I thought. Any ideas?

Firm Type - OnLookup() Fee.SETRANGE(FeeType, Fee.FeeType::Firm); // IF the User knows what he wants only show that record IF “Firm Type” <> ‘’ THEN Fee.SETRANGE(Code,“Firm Type”); // you now have a filtered record set to show IF FORM.RUNMODAL(FORM::“Firm Fees”,Fee) = ACTION::LookupOK THEN VALIDATE(“Firm Type”, Fee.Code) ELSE VALIDATE(“Firm Type”, ‘’); // Set the firmtype to blank Firm Type - OnValidate() IF “Firm Type” <> ‘’ THEN TESTFIELD(Member, TRUE); -------------------------- David Cox MindSource (UK) Limited Navision Solutions Partner Email: david@mindsource.co.uk Web: www.mindsource.co.uk

Hi, sometimes CurrFieldNo <> 0 may help solve this kind of problem. CurrFieldNo is only initialized when a user puts data in from a form, otherwise it is 0. Alex

David, sorry that code did not work. What I really want to do is somehow avoid validating the field when the OnLookup is used from a report request form. Alex, you can see in my original posting that I have tried using CurrFieldNo, but it still returned the field number, not zero as I hoped.