Posts

Bing Maps PCF Control

Image
Bing Maps PCF ControlOverviewThis PCF control allows you to display information for a view that contains latitude and longitude information within Bing Maps. The Info Box for each pushpin that is created on the map also gives you the ability to open the selected record.Additional FeaturesMap will default to a bounding box defined by the location data being shown.Will work with dataset that are 5k+ in size.Installation UsageAfter you install the solution into your system create a new view and add the custom control to the view. Ensure you add the required fields to the view and any filter you want. After you create the view Publish the customizations and navigate to the new view. The video below provides additional details.DownloadThe latest release is always available here.

Utilize Customized npm Package from GitHub Branch

Image
Utilize Customized npm Package from GitHub BranchWhen working with npm libraries there are times you find bugs or want to add functionality to a library. You could just modify the files locally and run the application but this gets tricky when you go to deploy an application and it does an npm install which doesn’t include your changes.If the project is out there on GitHub there is a better way.Fork the project on Github to your account.Create a new branch from your fork.Fix the bug or add the functionality you want.Uninstall the original npm package by opening a terminal within the directory of your project and running the following command.npm uninstall <package-name>Example
npm uninstall node-simple-odata-serverInstall the npm package from your Forked branch using the following command from a terminal within your project directory.npm install --save <your-github-user>/<repository-name>#<branch-name>Example
npm install --save rwilson504/node-simple-odata-serve…

Azure Maps PCF Control

Image
Azure Maps PCF ControlOverviewThis PCF control allows you to display information for a view that contains latitude and longitude information within Azure Maps. The Popup Box for each point that is created on the map also gives you the ability to open the selected record.Additional FeaturesUtilizes a central configuration entity for authentication which means not having to update multiple controls if authentication changes.Map will default to a bounding box defined by the location data being shown.Will work with dataset that are 5k+ in size.DownloadThe latest release is always available here.

Custom Grid/Subgrid Using Office-UI-Fabric DetailsList

Image
Custom PCF Grid/Subgrid Using Office-UI-Fabric DetailsListAllows you to simulate the out of the box Grid and Subgrid controls using the Office-UI-Fabric DetailsList control. It was built to provide a springboard when you need a customizable grid experience. This component re-creates a mojority of the capabilities available out of the box in less than 300 lines of code and demonstrates the following:Using the DataSet within a React functional component.Displaying and sorting data within the Office-UI-Fabric DetailsList component.Rendering custom formats for data with the DetailsList component such as links for Entity References, email addresses, and phone numbers.Displaying field data for related entities.React Hooks - the component uses both useState and useEffect.Loading more than 5k records in DataSet.Retaining the use of the standard ribbon buttons by using the setSelectedRecordIds function on the DataSet.Detecting and responding to control width updates.

Use Dynamics WebAPI to get Record Count

Use Dynamics WebAPI to get Record CountWhen working in an environment where tools like XrmToolbox are not available or allowed getting a total record count can be a real pain sometimes. One way of doing it just using the browser involves using the Dynamics WebAPI. This came in handy last time we were doing a data load on our production system and wanted to see the status of how many records had been imported.Small Data Set ( < 5k)If you are trying to get the count for 5,000 or less records. you can do a simple count on the data.Format/api/data/v9.0/<Entity Set Name>/?$count=trueExample/api/data/v9.0/contacts/?$count=trueData Returned{"@odata.context":"https://org.crm.dynamics.com/api/data/v9.0/$metadata#contacts","@odata.count":3,"value":Large Data Set ( > 5k & < 50k)If your record set will have 5k or more you can utilize the webapi by creating a FetchXml aggregate query, this does have a limitation of 50k records.Query Form…

Use Dynamics WebAPI to get LogicalName or ObjectTypeCode for Entity

Use Dynamics WebAPI to get LogicalName or ObjectTypeCode for EntityIf you need to get the LogicalName or ObjectTypeCode of an entity in your Dynamics environment you can utilize the WebAPI to get the metadata.If you have the LogicalName of the entity you can use this url.
Format:
<Dynamics Url>/api/data/v<Version>/EntityDefinitions(LogicalName='<LogicalName>')?$select=ObjectTypeCodeExample:
https://org12345.crm.dynamics.com/api/data/v9.0/EntityDefinitions(LogicalName='account')?$select=ObjectTypeCodeData Returned:
{"@odata.context":"https://org6744e6cd.crm.dynamics.com/api/data/v9.0/$metadata#EntityDefinitions(ObjectTypeCode)/$entity","ObjectTypeCode":1,"MetadataId":"70816501-edb9-4740-a16c-6a5efbc05d84"}If you have the ObjectTypeCode of the entity you can use this url.Format:
<Dynamics Url>/api/data/v<Version>/EntityDefinitions?$filter=ObjectTypeCode eq <ObjectTypeCode>&$select=Logic…

Convert Markdown Documents to PDF Using md-to-pdf

Image
Convert Markdown Documents to PDF Using md-to-pdfAzure DevOps now has an option to link your Wiki to a repo. With this change I decided to start creating all my documentation in Markdown and then to supply my users with PDF output for things such as user guide. This allows me to source control my documents and still supply users with clean looking outputs. Here is how i went about doing this.Create Documents Folder/PackageI started by creating a new folder for my documents and running the npm init command.Install md-to-pdf from NPMInstall the md-to-pdf npm package by running npm i --save-dev md-to-pdfCreate Index.js fileCreate a index.js file in the root directory of your folder and copy the following code.const mdToPdf = require('md-to-pdf'); const config = { "pdf_options": { "format": "Letter", "margin": "15mm", "displayHeaderFooter": true, "headerTemplate": "<style>section {padding-left…