- Use Visual Studio for the best experience.
- After cloning the repository, open the solution file in Visual Studio.
- Build the solution to restore the NuGet packages and transpile the TypeScript source files.
To generate TypeScript declaration files based on our Dynamics 365 solution, we use XrmDefinitelyTyped.
- Create an
XrmDefinitelyTyped.exe.config
file in the XrmDefinitelyTyped folder - The contents of this configuration file should be similar to the following:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="url" value="https://<your_instance>.crm3.dynamics.com/xrmservices/2011/Organization.svc" />
<add key="username" value="username@tc.gc.ca" />
<add key="out" value="../typings/XRM" />
<add key="solutions" value="<your solution>" />
<add key="entities" value="<comma separated list of entities>" />
<add key="web" value="" />
<add key="jsLib" value="../Webresources/lib" />
<add key="mfaAppId" value="51f81489-12ee-4a9e-aaae-a2591f45987d" />
<add key="mfaReturnUrl" value="app://58145b91-0c36-4500-8554-080854f2ac97"/>
<add key="method" value="OAuth"/>
</appSettings>
</configuration>
NOTE: The Multi Factor Authentication paramaters (mfaAppId and mfaReturnUrl) in the sample above are dev/prototyping values provided by Microsoft. Don't use these values against PROD.
- After setting up this configuration file, you can run the
XrmDefinitelyTyped.exe
executable to generate the Xrm Types.
- TypeScript source is located in the
src\ts
folder. - Whenever the solution is built, the TypeScript files are transpiled to
Webresources\js
. If you don't see the transpiled file, be sure theShow All Files
option in theSolution Explorer
is on. - The JavaScript source files are the files that are mapped for deployment in our D365 environment as defined in the
spkl.json
configuration file. - When creating a new script, start with TypeScript and be sure to map the resulting transpiled JavaScript in the
spkl.json
file.
- These can be directly created in the
Webresources
folder under the subfolder matching the type of web resource (i.e. html or css). - Mapping these to the D365 web resources are also done in the
spkl.json
configuration file.
- To manually deploy web resources, open a Developer Command Prompt.
- Be sure to be in the
TSIS2.WebResources\spkl
directory. - Use the
deploy-webresources.bat
batch file to deploy web resources.
NOTE: The solution that the web resources are deployed is configurable in the spkl.json
configuration file.
To learn more about the the tool we use for deployment, check out the spkl task runner.