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 :
Microsoft Dynamics AX (Archived)

How to Filter AX Grid with Multiple Records without comma separated values

(0) ShareShare
ReportReport
Posted on by 1,163

Hi Guys,

I am having this basic requirement that in a standard AX 2012 R3 Grid form , user should be able to filter records.

However the standard AX filter allows filterations of only one record.

EG.

Grid Form A having Item Itemid in column A having Items Item1 to Item100.

So if a user wants to filter out some random items which he gets in email , he has to rewrite all those items in a notepad with comma separated as shown below.

Item1,Item45,Item56,Item6,Item56.. and so on....

Is there a way that the user can select the items from the excel and just paste it in the filter and it gets filtered.This is something other ERP's offer.

Also the filteration with comma separated is also having some length issues that is the reason user can filter only 20-25 items with comma separated values.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    237,805 Most Valuable Professional on at

    No, it's not true that "the standard AX filter allows filterations of only one record" - you can use patterns such as Item1*.

  • Martin Dráb Profile Picture
    237,805 Most Valuable Professional on at

    You can learn more in Advanced filtering and query options on TechNet.

  • Vikas Mehta 21 Profile Picture
    1,163 on at

    Hi Martin,

    Thanks for the quick response.

    Apologies for not clearly explaining the requirement.

    I know that there are wild card options and the options available as shared by the link provided by you ,but what we need is that a end user will have random items(not is sequence) which needs to selected from around thousands of items so the only option he is left with is to create a list of items of his requirement in a comma separated format and then filter the grid which is very cumbersome.

    Also the grid filter has limits for the length of the string used to filter.

    So the end user needs some other way around to fix this issue.

  • Suggested answer
    PrzemekG Profile Picture
    725 on at

    Hi,

    Use this Excel VBA macro to copy items from table and paste them in AX as a string.

    Sub AxaptaStr()

    Dim Slc As Range
    Dim sc As Range
    Dim mStr, rStr As String
    Dim mTxt As DataObject

    Set Slc = Selection
       
    For Each sc In Slc
        If sc.Value <> "" Then
            rStr = sc.Value & ","
            mStr = mStr & rStr
        End If
    Next sc

           
    Set mTxt = New DataObject
    mTxt.SetText mStr
    mTxt.PutInClipboard
           
    Selection.Interior.ColorIndex = 36

    End Sub

    It turns this:

    item1
    item2
    item3
    item4
    item5
    item6
    item7
    item8
    item9
    item10
    item11
    item12
    item13
    item14
    item15

    Into this:

    item1,item2,item3,item4,item5,item6,item7,item8,item9,item10,item11,item12,item13,item14,item15,

    Hope this helps.

    Regards,

    PG

  • Martin Dráb Profile Picture
    237,805 Most Valuable Professional on at

    If you say that your current solution is cumbersome, use a better solution. Your current design isn't "the only option".

    For example, you may want to utilize your expensive system instead of sending Excel files by e-mail - it's sounds like bypassing the system. Or maybe you should utilize the Excel add-on. I can't be any more specific, because I don't know what data users gets by email, why they then filter something in AX etc.

    If you want a dialog where people will put some text from Excel in a format known at design time, you can build it as a customization.

  • Martin Dráb Profile Picture
    237,805 Most Valuable Professional on at

    Regarding the code above, it will still run into the limit of length for individual range values. The right solution would be creating multiple query ranges.

  • Vikas Mehta 21 Profile Picture
    1,163 on at

    Thanks

  • Suggested answer
    Vikas Mehta 21 Profile Picture
    1,163 on at

    OK got your point. Thanks a lot

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans