Can I import related web resource in Dynamics CRM? - dynamics-crm

I want to be able to import related web resource, like utility web resource, from my current web resource in Dynamics CRM. This will allow me to split my code across multiple files rather than including everything into a single web resource file.
Something like:
import * as dateUtil from '../util/dateUtil.js'
I have already tried stacking them in Dynamics itself. But what I really want is for Dynamics itself to pull the related web resource after I specify it as imports.

I think you can solve this by adding the utility web resource as dependency in current web resource.
With Dynamics 365 for Customer Engagement apps version 9.0 the behavior for JavaScript web resources is enhanced so that any other web resource listed as a dependency to the JavaScript web resource will be loaded along with the JavaScript web resource.
Reference

You can either can use webpack to resolve those imports for you at transpile time and form one single javascript file OR you use tools like head.js or require.js. Those are actually used by some Microsoft apps like proejct services.

Related

Xrm object undefined on SiteMap Html web resource in D365 Online

I have an Angular html page that has script reference to the javascript. In the Javascript I am using Xrm object to make certain actions like Xrm.webApi.retrieveMultipleRecords etc..
This Angular Html Web resource is loaded as part of SiteMap. The Angular Html web resource also have script reference to "ClientGlobalContext.js.aspx" and able to access Xrm object.
If I remove the aspx script reference the Xrm object is undefined. Microsoft docs mention that this script reference doesn't make the Xrm object available but in my case it's exactly what it is doing.
Then I tried removing the "ClientGlobalContext.js.aspx" reference and started using parent.Xrm object and everything seems to be working fine again. But the Microsoft docs again said that parent.Xrm will not work if loading an HTML web resource as part of SiteMap which exactly is my scenario and seems to be working.
So need to know what I should do as I don't want to use any methods that's going to be deprecated.
Here is the link to the Microsoft docs: Screenshot of the issue
https://learn.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/getglobalcontext-clientglobalcontext.js.aspx
I had a similar problem using Xrm.WebApi object in a Web Resource as well.
See here: Using Xrm.WebApi method in Web Resource opened in a new window
The short answer is, is that the methods rely on JavaScript constants that are only loaded on the CRM pages. You can work-around the issue by providing your own constants, and copy the values from window.opener.top.

How to create a MS Dynamics CRM app

I would like to create a Visual Studio project to my Dynamics site.
I'm using .NET and Javascript. My target is create a component (html + javascript/angular/...) and add this component into my dynamics page layout (or somewhere in dynamic site to see my UI).
My project has Back-end as well which using web API and get Dynamics CRM metadata by Client Object Model and send result to the component.
I finished my backend API and client HTML component. But I don't know how to install my app and show my component into my Dynamic site.
Could anyone share me some tutorials or demos related this?
To get you started... the general way to add things into CRM is via unmanaged or managed Solutions: https://msdn.microsoft.com/en-us/library/gg334576.aspx.
The solution that contains everything is called the Default Solution. You can get to it by going to Settings > Customizations > Customize the System.
You can put your JavaScript code into one or more web resources. Then add them to a form and register them on the OnLoad, OnSave, or individual field OnChange events.
C# code goes in as a Plugin Assembly or a Custom Workflow Assembly. To register those, use the Plugin Registration Tool, which is available in the SDK.
Once your plugins are registered, you can add them to a solution and port them to other systems.

Mulesoft API Designer auto load RAML file

I can see how you can import/export zip files containing RAML files using API Designer.
I would like to give the URL of the API Designer to someone to view a RAML file that I have created.
Is there any way to automatically import a zip file (perhaps from a URL) into API Designer rather than having to send them a zip file and have them import it?
currently there is no way to expose your RAML directly from the API Designer for someone to consume - that said, you need to expose it by yourself somewhere. Unfortunately, there isn't a way to import the RAML from a URL either, but that is a really good idea. I will file an issue for you.
https://github.com/mulesoft/api-designer/issues/366
If you are using Anypoint online instead of a local API Designer you can expose the RAML via a public or private API Portal.
By Anypoint studio online you can expose your RAML as public API portal and RAML resources can access from there, also able to download your raml as zip from there.

injecting web module into ASP.NET MVC3 application

i am developing an ERP Application, and wanted to structure it in such a way that, i can inject some other MVC web modules into its AREA at later time. this is what something like ORCHARD does. i need to know any such solution available?
to further elaborate my question, consider my application Named "MyERP" has two sub modules in its area.
1. HRM.
2. FRM.
and released this application to my client. later after release i decided to include another module for (AMS)Attendance Management System. so i wanted to structure MyERP in such a way, that my client can install this AMS module through MyERP web interface.
You may take a look at the following article which illustrates how a sample plugin system could be implemented. The project uses the custom virtual path provider that was presented in the following article and which allows to embed razor views as resources into separate assemblies.
i found this article helpful for my question.

What do the different scopes in WSPBuilder do?

When creating a new WSPBuilder project or new WSPBuilder item in Visual Studio, you get to choose the scope of the item being created. The options are Web, Site, WebApplication and Farm. What do the different scopes do, and how does that affect deployment? How do you determine which scope to use?
The scopes refer to the 'feature scope level'. Feature scope determines where the functionality that the feature provides can be used.
Farm: In a single SharePoint farm and across all its web applications, site collections and webs
WebApplication: In a single web application and across all its site collections and webs
Site: In a single site collection and across all its webs
Web: In a single web
Your choice of scope depends on the type of feature you'd like to use and where you'd like to use it. If you want to restrict the use of a custom action feature in one particular web then don't allow its scope to be used at WebApplication level. Also, depending on what type of feature you are creating, not every scope is an available option (see this list of feature types and the different scopes that apply).
It's basically an "activation context" for features.

Resources