Posts

Launch A Canvas App In Model App From SiteMap

Image
Canvas PowerApps provide a great amount of functionality with little or no code. Many examples demonstrate how to open a Canvas App within a Model App on a specific record and pass the context of that record.What if you don’t want to open a Canvas App for a specific record? Let’s say you want to create a menu functionality for user to allow them to open other Canvas apps, or maybe you have developed a Canvas app which provides a file conversion function which doesn’t relate to records at all. It would be nice if we could easily load these types of Canvas Apps from the SiteMap. Here is how to get this done.This solution is based off the solution from Dynamict but I have made some improvement that allow you to utilize the same WebResource over and over again and also provides information from the originating Model App.Here is an example of a Canvas app I have created which will display a menu of items which the user can launch. The Canvas App is being called from the SiteMap link i…

Pass Custom Parameters To WebResource From UIC SiteMap in Dynamics

Image
While working on creating a page to open a Canvas app full screen inside of a Model app I wanted to create a WebResource I could use over and over again. Most of the references I found showed the Canvas app name in the code which wouldn’t allow for code re-use. Instead I wanted to pass query string parameters to the WebResource so that it could get the name from the URL. The problem I ran into was with the new UCI interface and how it handles WebResources. After a bit of trial and error I found the trick was not using the WebResource type in the SiteMap editor but instead using a URL in the correct format and passing the parameters I needed within the Data parameters.Update- After working with the Maker Portal SiteMap editor I have realized that it will auto decode all of your Data parameters. Instead of using the Maker portal you will need to update the SiteMap using [XrmToolbox] or another XML Editor.Use XRMToolbox SiteMap editor to create your sub area.
Do not use the Maker Por…

Move from using Xrm.Page to formContex in UCI form based PowerApps WebResources

Image
The usage of Xrm.Page is currently deprecated, still available due to it’s high usage, but still deprecated. When will it go away, we don’t really know yet. How then can we use it’s formContext replacement within a web resource. Well Microsoft recently added a the getContentWindow() function to the context which allows us to get the actual content of a web resource. By adding an onload function to our form and utilizing getContentWindow() we can now call javascript on our web resource and pass it the formContext. Additionally you can add the context to the window object of the web resource so that the formContext can be used throughout the lifecycle of the web resource.Here is a quick tutorial on how to pass the formContext to a WebResource on a UCI Form.
formContext in WebResource
Form OnLoad Code// This should be in a script loaded on the form. // form_onload is a handler for the form onload event. function form_onload(executionContext) { var formContext = executionContext.get…

Sparse Checkout with Git To Reduce Confusion

Image
If you would like to make updates to the Xrm types or any others in the DefinitelyTyped project on github you can find that cloning all the types can be a real pain. This is because a typical git clone will bring down everything and having over 6 thousand directories in this project can make thigns a bit slow. Startign with Git version 2.25.0 a new feature was introduces called sparse-checkout. This feature can be used to limit what is brough down in your git requests much like a .gitignore file, in fact it even uses the same filtering formats. The benefit of using this new feature is that you don’t need to update the .gitignore file which would be tracked in the changes. Instead these options are stored in your repo settings locally and will not show up as changes to your files.Let’s take a look!Here is my types directory in DefinitelyTyped clone. You can see that there are a lot of types, over 6K in fact. Righ now every time you do a pull it can take a little while because of …

Multilingual Support For PCF Calendar Control

Image
Multilingual support has been added to the Calendar component I recently shared. This works in both Canvas and Model apps.The following languages are now supported.English (default)GermanFrenchSpanishItalianDutchRussianClick Here to download the latest release of the component.
Click Here to get the source code for this component.Check out these videos on how to get the control working in a multilingual setup.
Canvas Apps Multilingual Setup

Model Apps Multilingual Setup

Gotchas for PCF Code Components in Canvas Apps

Image
PCF Code Components allow developers to create their own custom interfaces utilizing Typescript and/or React. To learn more about the PCF Component Framework check out this article. Building these controls has been great in Model app but only recently could we also start re-using them in our Canvas apps.If you want to learn more about how to add your PCF Code component to a Canvas App check out this article from Microsoft.Now that these controls can be utilized within Canvas Apps there are a few things to watch out for. Some of these are bugs that should be fixed when this all comes out of Preview and into General Availability.ControlManifest.Input.xmlThe ControlManifest.Input.xml file is where you define your component information and all the properties associated with it. Below are some gotcha that will cause you errors when attempting to deploy your component into a Canvas app.Be Careful of XML Escape CharactersWhen defining your component it’s important to add descriptions to e…