Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Workspace not showing the required results

(4) ShareShare
ReportReport
Posted on by 67
I have created a custom workspace that has a tile, clicking on it should show only 1 record but instead, it is showing all the records. The following is the view that is added to the workspace. It's a custom form with a custom code on the init event that is called.
 


Following is the code written on the init of form:
 


Workspace:
clicking on my view it should show the above data of record, but instead it is showing all the records but applying the filters given in the else statement of above given code.
I want to get the filters saved by the user in the saved view added to the workspace. Kindly guide.
 
  • Waed Ayyad Profile Picture
    Waed Ayyad 6,842 Super User 2024 Season 2 on at
    Workspace not showing the required results

    Hi, 

    Is your issue resolved? If yes, mark the answers that helped you as verified. 

    Thanks,

    Waed Ayyad

  • Suggested answer
    Waed Ayyad Profile Picture
    Waed Ayyad 6,842 Super User 2024 Season 2 on at
    Workspace not showing the required results
    Hi,
     
    Maybe you can create two menu Items one for form and another for tile, and in the init of the form you check what is the caller menu item and filter based on it, but I think it is better to use only the code. or if you can create different menu Items and Query for each case of the form.
     
     

    Thanks,

    Waed Ayyad

    If this helped, please mark it as "Verified" for others facing the same issue

     
     
     
  • Layan Jwei Profile Picture
    Layan Jwei 7,484 Super User 2024 Season 2 on at
    Workspace not showing the required results
    Hi,

    So sometimes you want the status filter only and sometimes you want both the status filter with DocumentId?


    based on what do you decide if u want this or that? why not write code (if conidtion) in init method to only apply filters based on your condition?
  • SA-20091232-0 Profile Picture
    SA-20091232-0 67 on at
    Workspace not showing the required results
    I get these filters when I click on the workspace tile. These filters are being added through code under the else condition(See the code that I shared above in my query). 
    So what happens is, when I click on the tile, the view that opens is correct but instead of applying the range that is saved on that view it is using the ranges written on the OnInit method of the form in the code.
    I want to bypass that for user-specific workspaces, and view.

    Ranges that are applied through code(Bypassing the user specific range set for this view when we click on tile):
     


    Expected Ranges it should apply:

  • Layan Jwei Profile Picture
    Layan Jwei 7,484 Super User 2024 Season 2 on at
    Workspace not showing the required results
    Hi,

    when you click on the tile, and the form opens, click on the filter icon and check the filters, do they really match what you want?
     
     
    Also when debugging and after applying all filters, can you extract for us the result of the final query?
  • Waed Ayyad Profile Picture
    Waed Ayyad 6,842 Super User 2024 Season 2 on at
    Workspace not showing the required results
    Hi,
     
    Did you try to debug the code? Do you have any filters on the saved view other than the filters that you added by code?
    If you open the form without workspace, does it return the one record? 
     

    Thanks,

    Waed Ayyad

     

     
     

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Share Your Event with the Community

Jump start your event engagement! 📢

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,646 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans