web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Retrieve System views based on model driven app

(0) ShareShare
ReportReport
Posted on by 700

Hi,

We have created two Model-driven apps and one for a salesperson and the other for a service person. In the app, we have added specific views so that each app has access to proper views. It's working correctly from CRM. We have also developed one HTML application in which we read the view list. But in our HTML its shows all the views so that when salesperson opens the HTML then they see all views but it should only show those that are available in their model-driven app. Is there any API or script using which we can read system views from CRM that are defined in the model-driven app.

Thanks!

I have the same question (0)
  • Balasaheb Profile Picture
    700 on at
    RE: Retrieve System views based on model driven app

    Hi Xavier,

    Thanks for your reply. It is really helpful.

    Thanks!

  • Suggested answer
    XM-22040801-0 Profile Picture
    11 on at
    RE: Retrieve System views based on model driven app

    You can use the WebAPI function: /api/data/v9.2/RetrieveAppComponents(AppModuleId=<AppModuleId>)

    This function use the appmoduleid instead of appmoduleuniqueid

    If the app includes all views, the result will not contain componenttype = 26

  • Suggested answer
    Balasaheb Profile Picture
    700 on at
    RE: Retrieve System views based on model driven app

    Hi Xavier,

    Thanks for your reply. We have checked the above Web API queries but they did not work. When we got the “appmoduleidunique” from “appmodules” and then pass in _appmoduleidunique_value field in appmodulecomponents but it did not return anything.

    For troubleshooting when we fetch all appmodules and then all appmodulecomponents and when we tried to find _appmoduleidunique_value from  “appmodulecomponents” in “appmodules” then it did not find it.

    pastedimage1680161402238v1.png

    pastedimage1680161426564v2.png

    We wanted to confirm from where we get the value for _appmoduleidunique_value.

    Thanks!

  • Suggested answer
    XM-22040801-0 Profile Picture
    11 on at
    RE: Retrieve System views based on model driven app

    Hi,

    You can use appmodules => appmodulecomponents to find the views of your application.

    With WebAPI :

    1. Find appmoduleidunique: appmodules?$select=appmoduleidunique&$filter=uniquename eq 'AppName'

    2. Find system views: appmodulecomponents?$filter=componenttype eq 26 and _appmoduleidunique_value eq 'appmoduleidunique'

    System view = 26

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
DAnny3211 Profile Picture

DAnny3211 134

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 115

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 70 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans