How to build custom pages in CRM Dynamics? - dynamics-crm

I am a beginner to CRM Dynamics. I want to build a web page in CRM Dynamics. Example like Registration page, Listing page of users i.e. any page which displays data based of custom business logic and pages should be authorized only to authorized users.
I just want to build site just like we do with Salesforce using visualforce pages and custom apex classes and all.
How to achieve same thing in CRM Dynamics? and what are ways to achieve this?

The Sitemap allows you to bind to a custom webresource.
You might want to start by adding to your Stitemap an item that links you to your custom HTML page and then work with json, jquery, for your business logic.
From the HTML you can call actions using Process.js and run C# logic.
Alternatively you can consider Portal.

I often use the WebApi endpoint, an html web ressource and a single-page application javascript framework, like Knockout, to achieve this.
The important is to host every component as a web ressource or use a CDN.

Related

Add cart functionality to API or to Client?

I am creating an e-commerce API using the Django Rest Framework. The API will handle the following areas:
Databases
User Registration
Permissions
Orders/Payments
There's still one area in which I'm not quite sure how to implement in my project. It's the cart functionality. Would it be better to implement it on the client-side (ex: React/Ember) or on the server-side (i.e. API)?
One scenario that confused me is if the user is logged in in different platforms (ex: Website and mobile app). I want the user to have the same cart on mulitple platforms.
In that particular use case, if you want cart persistence then it must be backend. The reason for this is one being able to have a single source of truth. The phone app and the web app cannot talk to each other unless they have some sort of "common ground" between them.
That's where the API comes in. It will allow both ends to speak to each other by having the API as the single source of truth. See my terrible diagram for a visual.

Calling Dynamics CRM Rest API from PCF component, Embedding in Model-Driven App

We are working on a Canvas app that allows user to perform bulk operations such as assigning roles to users, manage privileges, etc. For this, we created a custom connector at the PowerApp that calls the Dynamics CRM Rest API to perform various operations using swagger JSON. The Azure AD tokens have been used for authentication.
To avoid various UI limitations and challenges, we are now planning to switch to model-driven app. Two questions:
1. How can we create a PCF component that consumes/call aforesaid Dynamics CRM rest API?
2. How to embed this component on Dynamics CRM model-driven app, so we can use them in Model-driven apps?
How to embed this component on Dynamics CRM model-driven app, so we can use them in Model-driven apps?
If you decided to use PCF as your component instead of web resource, better know the limitations. PCF control can be rendered either as a field control or dataset control which means you are going to replace the textbox or subgrid into something else for visualization.
Documentation says:
- Replace a field that displays a numeric text value with a dial or slider code component.
- Transform a list into an entirely different visual experience bound to the data set like a Calendar or Map.
How can we create a PCF component that consumes/call aforesaid Dynamics CRM rest API?
If it’s web resource, we will simply utilize Xrm.WebApi for calling crm web api within HTML/ js webresource in same context.
If it’s PCF, still crm context will support you like this:
this._context.webAPI
.retrieveMultipleRecords(TSWebAPI._entityName, queryString)
.then(........
Learn more: Code Reference
Good thing with both of these approach is, no need of extra authentication or token. As they are running inside CRM, current user context will be used. If you want to impersonate some privileged service account for role assignment, it’s possible too using web api header.

Choose a different default Entity Form in the CRM Dynamics 365 Mobile App and Web?

We're just getting into making our CRM 365 OnPrem environment work well using the Mobile App, but the forms we display on web just don't layout well on the 365 Mobile App. I hoped there would be some way to select a different Default Form for the Mobile App and Web depending on how the user comes in, but I haven't found anyway to do this.
Makes since that the two different environments wouldn't be laid out the same way, so I'd like to build a Form for Mobile App and one for Web so I can arrange the fields accordingly. Just no logical way to use the same layout on both.
Thanks for any advise.
You can have two different forms, design the layout (tab, section, fields) for Web & Mobile (UCI) app in two different forms
For UCI app - we can control the form to render, by choosing the Mobile layout form as the only entity Asset. Read more
In Web - still user can switch between multiple forms using form selector, we may need script to land the users in the required form on form load using navigate()

Creating a separate web portal which manages custom entities inside dynamics365

I have an assignment which manages some custom entities of dynamics365 sales application. Is it possible to create a separate web application which resides in dynamics365 sales portal?
The web portal will have 5 to 6 menus and various forms with edit update delete, paging, sorting, searching. All the operations will be done in custom entities of the dynamics365.
Too broad. Possible.
for web application - Need to do custom development using metadata messages in SDK. Can host it separately.
https://msdn.microsoft.com/en-us/library/gg509014.aspx
Inside crm portal - this is not a typical requirement inside portal solution, so am doubtful. But still Asp.net page template is not available like adx in 365 yet.
https://readyxrmblog.wordpress.com/2017/03/14/liquid-markup-in-dynamics-365-portals-part-1-hello-world/
Other possibilities:
If we want to go with custom code inside webform: similar discussion
My wild guess - May be you can go with navigation link for your web app from portal.

Dynamics CRM Online - display custom aspx page

I need to know that is it possible to display a custom aspx page in online dynamics crm form?
You can display an external page inside an IFRAME on a form but you cannot host this .aspx page inside CRM.
If you need to implement special business logic that needs to access external resources, you could create a html webresource that uses js to communicate with a custom workflow action.

Resources