web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

NOT EQUALS IN A FILTER

(0) ShareShare
ReportReport
Posted on by 5
addafter(" ")
        {
            part("Produit"; "Produit")
            {
                ApplicationArea = all;
                SubPageView = where(Produit = filter(false));            
                SubPageLink = "No." = Field(Ref);
                Caption = 'Produit équivalent';
            }
        }
The No filter here is equals to Field(Ref), but i want all item not equals to field(Ref). I'm trying this one --> SubPageLink ="No." = FILTER (<>Field(Ref));
Which is not correct.

Thanks for your propositions
I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at

    Hi,

    the correct syntax is as follows:

    SubPageLink ="No." = FILTER (<>Ref);

    but when you are using FILTER, you can not use any variable with it, instead it requires a hardcoded values with <> operator.

    In either way you can extend your open page trigger of sub page with the Header page values.

    Thanks.

  • Suggested answer
    YUN ZHU Profile Picture
    95,331 Super User 2025 Season 2 on at

    As Nitin mentioned, You can only use <> in Filter.

    pastedimage1661300865342v1.png

    If your needs are more complex, you can refer to Item Attributes Factbox (9110, ListPart), this Factbox is not associated with SubPageLink.

    Hopefully the link below can give you some hints.

    https://yzhums.com/25011/

    Thanks.

    ZHU

  • Mohamed Ali ELLOUZE Profile Picture
    5 on at

    Hi,

    Thanks for your request, I m testing with a variable named recNo = value of ref field, then i use

    "No." = FILTER(<> recNo)

    But the problem still exists

    Capture-d_1920E900_cran-2022_2D00_08_2D00_24-085149.png 

    The problem is resolved when i make "No." = FILTER(<> '21174') 

    There no way to have a variable ? 

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    The filter value have to be a text so you should try use the use this command to format your filter value correctly when you have a variable that you want to be part of the filter

    something like FILTER =(STRSUBSTRNO('<>%1,recN);

    It can be smart to check the filter value in the debugger or in a message so you see that it is formatted correctly.

    docs.microsoft.com/.../text-strsubstno-method

  • Mohamed Ali ELLOUZE Profile Picture
    5 on at

    I'm trying this one: 

    "No." = FILTER(StrSubstNo('<> %1', recNo) )

    Capture-d_1920E900_cran-2022_2D00_08_2D00_24-092459.png

    Then I declared a new Text var : 

     myText := StrSubstNo('<>%1', recNo);
    And i do like this : 
    "No." = FILTER(myText) --> always wrong
    although when i check the myText value in a message it's OK --> 
    Capture-d_1920E900_cran-2022_2D00_08_2D00_24-091820.png
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,105 Moderator on at

    I think you set your filter incorrectlty.

    You should say rec.setfilter("No.",myText);

    SETFILTER Function (Record) - Dynamics NAV | Microsoft Docs

  • Mohamed Ali ELLOUZE Profile Picture
    5 on at

    I can't do setfilter in this context, i would like to do this filter in the subpagelink.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans