Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Workspace tile

Posted on by 6,190 Super User 2024 Season 2
Hi All,
 
In case I have a tile that is connected to a menu item that doesn't have a query from where the tile reads its count, Also, if I want to override the query of a form by code, the tile does not get the correct count, although the form returns the correct data (when you click on the tile)
 
Regards,
Waed Ayyad
  • Suggested answer
    Layan Jwei Profile Picture
    Layan Jwei 7,303 Super User 2024 Season 2 on at
    Workspace tile
    Hi Waed,
     
    I know you already verified the answer. When I first saw your comment about the ranges, i thought it's a mix between two tables (Table1 and Table2) maybe I saw wrongly or you edited the message.
     
    Andre's answer is correct. However I would like to add something. Does your enum has the isExtensible as true? If yes, then it's not good to use hard-coded numeric numbers, because this enum number might be different in another environments like UAT or PROD, which might cause issues. And in general it's not good to use hardcoding, It's better to use Enum::A instead. But not sure if it will work in your case. Give it a try and let us know.
     
    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Verified answer
    André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,101 Super User 2024 Season 2 on at
    Workspace tile
    Hi Waed,
     
    You can try a query range like this if the enum and the string values are fixed.
     
    (InventTrans.StatusReceipt != 5) || ((InventTrans.StatusReceipt == 5) && (InventTrans.ItemId == "D0001"))
     
    In case the enum values or the specific string values are variable, you can follow the guidelines mentioned by Layan.
  • Suggested answer
    Layan Jwei Profile Picture
    Layan Jwei 7,303 Super User 2024 Season 2 on at
    Workspace tile
    Hi Waed,
     
    I have a suggestion but I'm not sure if it will work as I didn't try it before. If you think your logic can't be achieved with an AOT query, then maybe you can still connect your tile to an AOT query but without any filtration or the minimum filtration you can accomplish.
    Then, you can override the getData method of your tile to add more filters to the query by code, then return the count of the query result.  But this might cause performance issues depending on the logic you will put

    Thanks,
    Layan Jweihan
    Please mark this answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Waed Ayyad Profile Picture
    Waed Ayyad 6,190 Super User 2024 Season 2 on at
    Workspace tile
    Hi @Andre,
     
    Let say the table name (Table 1), and I have 2 fields (Field 1, Field 2), I want to get all records from Table where (Table1.Field1  !=  Enum::Value1) || (Table1.Field1 == Enum::Value1 && Table1.Field2 = "specific string value")
     
     
    I want these ranges, so how can I add it to AOT query? or where should I add it in the code in order to the tile to read from it. 
     
     
    Regards,
    Waed Ayyad
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,101 Super User 2024 Season 2 on at
    Workspace tile
    Hi Waed,

    The method on the init() of the form is not executed to get the count on the tile. Can you explain about the required query? Maybe we can help you with an alternative using the query approach.
  • Waed Ayyad Profile Picture
    Waed Ayyad 6,190 Super User 2024 Season 2 on at
    Workspace tile
    Hi Andre,
     
    Yes, the count of the tile is incorrect, it returns the count of all data without any filter.  No, I don't add a specific AOT query for the Menu item, I write complex query in the init method of the form 
     
     
    Regards,
    Waed Ayyad
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,101 Super User 2024 Season 2 on at
    Workspace tile
    HI Waed,
     
    Do I understand correctly that the tile is giving an incorrect count, whereas when you open the form, the ranges are correct? Can you share what exact coding you used? Have you also added a specific query to the menu item for the tile?
  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 6,190 Super User 2024 Season 2 on at
    Workspace tile
    Hi,
     
    For a standard form, I need to create a custom tile. The tile should have ranges on the data source, but I am not able to add it using AOT query, so I create complex query and I added it to the init method of the form, the tile returns the count of the data without applying the ranges, but when I click on the tile the form is returning the filtered data based on my custom query. 
    What I did I created a new menu item and connected it to the form, and I overrided the code of init method (to add logic of query ranges)
     
    Regards,
    Waed Ayyad
  • Kevin Xia Profile Picture
    Kevin Xia Microsoft Employee on at
    Workspace tile
    Hi,
    Can you provide more information, such as some screenshots, or your specific parameter settings, the information you have provided at this time is not enough to support us to judge and solve your problem.
    Best regards,
    Kevin
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,101 Super User 2024 Season 2 on at
    Workspace tile
    Hi Waed,
     
    Can you explain your exact question? Where and how do you need help? Did you already create a customization and got stuck somewhere?

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,908 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans