Skip to main content

Notifications

Small and medium business | Business Central, N...
Suggested answer

Wild card search in custom page

Posted on by 31
Hey, 
 
I'm new to BC and I've been asked with I believe a complex request. 
The business wanted to filter purchase orders by dimension values, I initially created a table and page for them to enter the values for each dimension, each dimension is a text field, and they can use | to enter many values
 
Then I created a query where I made an outer join between the purchase order table and my new table and created a final page where they see the result, here is where I do the filtering using the onOpenPage trigger reading from the query and inserting into a temporal table used on the repeater section of the page. The filtering I was doing was simple, using the StrPos to see if the dimension code from the PO was found inside the text for the corresponding field in my table, but now the user wants to use wildcards: * and ? and so far, I haven't found a way to do it. I thought the string functions could support wildcards, but it seems they don't. I just want to confirm before saying no to the user.
 
Thanks!
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,472 Super User 2024 Season 2 on at
    Wild card search in custom page
    I think this requirement is not complicated. You just need to add the Dimensions ​​that need to be filtered to the page. Users can then filter by themselves using the standard filtering feature.
    For example,
    Dynamics 365 Business Central: How to add Dimensions to the page (Other than Global and Shortcut dimensions)
    How to add Shortcut Dimensions on the page in Dynamics 365 Business Central (Shortcut Dimension 3 ~ 8)
     
    Thanks.
    ZHU
  • Suggested answer
    Valentin Castravet Profile Picture
    Valentin Castravet 24,785 Super User 2024 Season 2 on at
    Wild card search in custom page
    Based on the information you added saved lists is what I would recommend as well. 
  • criztina Profile Picture
    criztina 31 on at
    Wild card search in custom page
    Actually, the first version of this report was done in Power BI and the filters were set in an excel file, once I had the permission to develop in BC I moved everything there as the report in the Power BI section looked very tiny and the frequency to refresh the data is at least every 30m, we've the pro license, but I may have to go back to Power BI lol, I'll try to use wild cards there and also will take a look at the list views.
     
    Thank you all!
  • MarceloBorges Profile Picture
    MarceloBorges 112 on at
    Wild card search in custom page
    It feels more like they need a PowerBI report rather than a Filter Page that does it all.
     
    Have you checked if Saved Views could also help here, so that they don't have to keep applying the same filters every day?
     
  • criztina Profile Picture
    criztina 31 on at
    Wild card search in custom page
    The need its very particular, user wants a report with a list of POs that match certain criteria based on dimensions that are pending of approval so they can approve them. They have like 20 filters, each filter uses one or more dimensions, it varies, we manage up to 5, so they want a report as making the search every day might be a bit heavy.
    I managed to do it by entering the values concatenated by | (if there is more than one value) for each dimension into a table, the issue now is that they want to use wildcards for each value, so instead of having finance|procurement for the department dimension they want to use * and ? into the values, let's say fin?nc?|proc*, just as an example.
    It seems this is not possible, so I will just say it can't be done
  • Suggested answer
    MarceloBorges Profile Picture
    MarceloBorges 112 on at
    Wild card search in custom page
    Hi,
     
    If your business need is to filter using dimensions that are not Global Dimensions 1 or 2 (which already exist on the Purchase Order Header), then I would suggest you have a modification to actually add Shortcut Dimension Codes 3 through 8 on the Purchase Header as table fields.... Not programmed fields.
     
    With this, users would be able to naturally filter on them using all the filter special characters right from the Filter pane on the Purchase Order list.
     
    Additionally, if you add these new Shortcut Dimension fields to the Purchase Order List page, you could also set them up as searchable using the "Search Company Data" functionality, and they could search directly from the Tell Me bar as well -- Not a very common use case, but not impossible.
     
    This would save a lot of this complex design including pages and joins and everything.
  • Suggested answer
    Valentin Castravet Profile Picture
    Valentin Castravet 24,785 Super User 2024 Season 2 on at
    Wild card search in custom page
    Without knowing all the details of your request/customization - this seems like overkill as Business Central already has functionality to enter dimensions on a purchase order and then having the ability to filter the purchase orders based on the 2 global dimensions. Likewise for purchase lines and all dimensions. Unless there was a reason, I would recommend looking into the out of the box functionality that does this. As the system already supports filtering based on wild cards. 
     

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans