Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Retrieve System views based on model driven app

(0) ShareShare
ReportReport
Posted on by 680

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!

  • Balasaheb Profile Picture
    Balasaheb 680 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
    XM-22040801-0 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
    Balasaheb 680 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
    XM-22040801-0 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans