Custom Code Tracing & Exception Logging in Dynamics 365 v.9

Sunday, October 28, 2018

As a Solution Architect I often review Microsoft Dynamics 365 custom server and client side code. One of the most common rejects regards tracing and exception handling mechanisms, or their absence. Some code constructs may have empty Try/Catch blocks or none at all, other catch exceptions and just re-throw. As for tracing, code often contains debugging ‘aids’ such as alerts and debugger statements or no tracing notifications at all. Why is this a reject? Unhandled raw exceptions float to UI, confusing and frustrating users while exposing internal implementation details to potential attackers System Administrator is unaware of custom code exceptions unless users decide...
no comments

Drag & Drop File Upload Revisited

Thursday, October 18, 2018

Finally found the time for overdue maintenance on the Drag & Drop solution I created two years ago. Why revisit? First of all, as the CodePlex platform, previous home of this solution, is being decommissioned, downloading the component got the whole CodePlex project and few visitors commented that they could not find the actual solution. So now you can download an unmanaged solution from it’s  new home @ Github. Second, I fixed a major bug related to the plural name of some entities. For most entities, appending ‘s’ to the entity schema name would result in the matching entity name for Web API. Some...
no comments

Microsoft Portal – Retrieve Dynamics 365 Data Asynchronously – Part 2

Monday, October 15, 2018

In part 1 of this post I demonstrated building and using a service which receives a FetchXML query and returns Dynamics 365 data to any Portal page in an asynchronous manner as a JSON object. This service is similar to the SDK’s RetrieveMultiple message. In this part 2, I’ll demonstrate a different service, which like the SDK Retrieve message, receives a record type, record id (GUID) and columns set to return the required data as a JSON object. This is useful when you already have a specific Dynamics 365 record id at hand and you want to retrieve additional data for...

Microsoft Portal – Retrieve Dynamics 365 Data Asynchronously – Part 1

Friday, October 12, 2018

Leveraging Colin Vermander brilliant article on using Liquid Templates to return JSON, I would like to demonstrate creating and using a ‘service’ to asynchronously retrieve Dynamics 365 data into any portal page. Why is this useful? Liquid Templates tags are rendered on server side before a response is returned to the browser, so FetchXML tag will return a static result once the page is returned. But what about responding dynamically to client side events such as option selection, button click or expending an element to view more details? Sending the page to the server again is no longer an option if you want...

Execute a Recurring Job in Microsoft Dynamics 365 with Azure Scheduler

Thursday, February 8, 2018

The requirement for recurring job execution is quite common in Microsoft Dynamics implementations. Here are some of the business requirements I have encountered: Send monthly newsletter to target customers Synchronize MSCRM Users details with Active Directory once a day Once a month, disqualify all leads that have no open activities Once every hour, export Appointments from mail server and import into Dynamics 365 Microsoft Dynamics 365 has no reliable built in scheduling mechanism that can be leveraged for custom solutions. The Asynchronous Batch Process Pattern I have written about in the past can be used with daily...
no comments

Walkthrough: Execute Azure Function from Microsoft Dynamics Entity Form

Tuesday, January 30, 2018

Azure Function is a fantastic mechanism for various integration scenarios. Here are few key characteristics: Being a serverless application, Azure Function has the best time to market when it comes to deploying a web service Pay-per-use pricing model means you pay only for what you use Built in integration options in PowerApps and Flow allows you to give non-developers new building blocks when designing application and processes CORS (Cross-Origin Resource Sharing) support allows consuming Functions from server/client side in any domain you find suitable What can you do with Azure Functions in the context of Microsoft Dynamics integration scenarios? Just about anything: Export/Import data to/from...
no comments

Entity JavaScript Scaffold

Saturday, July 23, 2016

In the last couple of years I have been writing more JavaScript code than Server side code in my Microsoft Dynamics CRM projects. Better UX, plethora of supporting JavaScript libraries, easier deployment and maintenance made me prefer a client side solutions. I usually create a JavaScript library for each entity requiring client side functionality (forms, command bars etc.).Over time, I have formed a JavaScript class scaffold. As this scaffold has improved my productivity when it comes to developing, debugging and maintaining client side code, I would like to share it here. Consistently using this or any other scaffold,...
no comments

Customization Aware Web Resource – Part 1

Friday, March 11, 2016

Web Resource is one of the most powerful and versatile extension mechanism in Microsoft Dynamics CRM. It supplies an open canvas to draw custom UI, business logic and whole applications within entity forms, dashboards and stand alone pages. Coupled with the plethora of  free JavaScript libraries out there, you can easily provide your users with advanced solutions that work with Microsoft Dynamics CRM Data. In that sense, Web Resource can implement a custom client which can also be embedded into MSCRM elements. One concern regarding the investment in Web Resource development is the loss of dynamic customization capabilities, which...
one comment

Asynchronous Batch Process Solution Revisited – part 3

Monday, August 10, 2015

In the previous post, I walked through the ABP Target Records Scenario. In this post, I’ll go through the Aggregative Query Scenario. Prerequisites 1. Download the Asynchronous Batch Process Solution, import into Microsoft Dynamics CRM 2015 on-premise/Online organization2. Go to Settings – > Solutions and Open the ABP solution. Go to the Batch Process entity definition and check the Settings checkbox in the ‘Areas that display this entity’ section3. Save and publish the solution As always, I advise against publishing any external solution on your production environment without testing it first. Aggregative Query Scenario ...

Logging and Handling Microsoft Dynamics CRM 2013 Exceptions – Part 3

Tuesday, July 15, 2014

In the previous post I described a solution to the business problem of logging & handling implementation level exceptions (presented in the first post of this series). In this post, I will supply an actual solution, demonstrate common usage scenarios and other solution features. Before I walkthrough usage scenarios, some implementation notes: In order to support exceptions raised from transactional components (such as Plugin registered to pre/post operation stages), the LogException method in ExceptionManagement.cs file is using the ExecuteMultipleRequest class to execute the e4d_LogExceptionRequest request. As the ExecuteMultipleRequest instance is external to the Plugin transaction, it manages to create the Exception record...