Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How to make a condition Field1 <> Filed2 in a View

Posted on by 350

Hi Everybody

Please, is it possible to make the condition "<>" using Views ?

My need : Make a Form to list Transfer Orders having QtyReceived <> QtyShipped.

I don't want to use SQL or X++.

Thanks.

*This post is locked for comments

  • JauB Profile Picture
    JauB 350 on at
    RE: How to make a condition Field1 <> Filed2 in a View

    Thanks a lot Martin, your first link works like a charm ;)

    Even i was obliged to use X++ for filtering the new computed column to fill my grid on with wanted data like that :

    public void init()
    {
        super();
        
    
        this.query().dataSourceTable(tableNum(MYVIEW)).addRange(fieldNum(MYVIEW,Ecart)).value('!0');
        this.query().dataSourceTable(tableNum(MYVIEW)).findRange(fieldNum(MYVIEW,Ecart)).status(RangeStatus::Locked);
      
        
        
    }


  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 230,235 Most Valuable Professional on at
    RE: How to make a condition Field1 <> Filed2 in a View

    Here is documentation: Walkthrough: Add a Computed Column to a View.

    I also explained it a bit in my blog post Subqueries in views.

  • JauB Profile Picture
    JauB 350 on at
    RE: How to make a condition Field1 <> Filed2 in a View

    Hi Martin

    Where Can i add this new column ? And when compute it ?

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,235 Most Valuable Professional on at
    RE: How to make a condition Field1 <> Filed2 in a View

    If you want to use a view, you can create a computed column which will compare QtyReceived and QtyShipped and return 1 or 0. Then you can easily filter by this column.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans