SETRANGE use

maschenadamaschenada Member Posts: 2
I want to apply to my GLEntry recordset a filter to "G/L Account No." field.

I have a string variable in wich value can is: '2110', or '2110..2220' or '2220|7130' and so on..

This is the code:

GLEntry.SETRANGE("G/L Account No.",myVariableString);

but no results

How I do it?

Comments

  • tlarsontlarson Member Posts: 27
    SetRange can only be used for the first two instances. You can use the function like this:

    GLEntry.SetRange("G/L Account No.",'2110');
    GLEntry.SetRange("G/L Account No.",'2110','2220');

    However, boolean logic (such as the or pipe, |) can't be used in SetRange. Instead, use SETFILTER for the third one:

    GLEntry.SetFilter("G/L Account No.",'2220|7130');

    Tim Larson
  • kinekine Member Posts: 12,562
    Look at SETFILTER instead SETRANGE... :wink:
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.