How to filter using OR in DataItemTableView?

AhMoiAhMoi Member Posts: 9
edited 2006-06-16 in Navision Attain
Hi there,

I am writing a report to display records from General Journal Line Table whose "Acc Type" = 'Bank Account' OR "Bal. Acc Type" = 'Bank Account'.

But, my problem is, WHERE(Bal. Account Type=CONST(Bank Account)|Account Type=CONST(Bank Account)) gives me error during compilation.
It keeps saying that an ")" is missing. :(

So, where should this missing ")" be placed? :?

Thanks for any help.
Ah Moi

Comments

  • bostjanlbostjanl Member Posts: 107
    AhMoi wrote:
    Hi there,

    I am writing a report to display records from General Journal Line Table whose "Acc Type" = 'Bank Account' OR "Bal. Acc Type" = 'Bank Account'.

    But, my problem is, WHERE(Bal. Account Type=CONST(Bank Account)|Account Type=CONST(Bank Account)) gives me error during compilation.
    It keeps saying that an ")" is missing. :(

    So, where should this missing ")" be placed? :?

    Thanks for any help.

    If you use filters on different fields than Navision allways uses AND. If you want to use OR, you should check each record in OnAfterGetRecord:


    OnAfterGetRecord()
    IF ("Gen. Journal Line"."Account Type" = "Gen. Journal Line"."Account Type"::"Bank Account") OR
    ("Gen. Journal Line"."Bal. Account Type" = "Gen. Journal Line"."Bal. Account Type"::"Bank Account") THEN BEGIN
    // Some processing if needed
    END
    ELSE BEGIN
    // Skip current record
    CurrReport.SKIP;
    END;


    Have you typed DataItemTableView manualy? If so why? Use bilt in support!


    Regards

    Bostjan
  • AhMoiAhMoi Member Posts: 9
    thanks a lot! My report is working great now! :P [/quote]
    Ah Moi
  • davida37davida37 Member Posts: 9
    thanks. this has helped me too!!

    from... new to navision writing!
Sign In or Register to comment.