Dynamics 365 Calling Update in SDK.REST Invokes Retrieve

In this post we will look at how calling the update method in SDK.REST causes a retrieve to run as well. This is something to note as you may have plugins that run on the retrieve of an entity, which may cause unintended consequences if not handled properly. Let’s create a plugin that will run on the Update of an account: Add the plugin assemblies through NuGet: And the code. … Continue reading Dynamics 365 Calling Update in SDK.REST Invokes Retrieve

View Dynamics 365 Metadata Through URL

To view the Dynamics 365 metadata through a URL, go to the Settings->Customizations and select Developer Resources: Copy the Service Root URL: Paste this into a browser and add $metadata to the URL, so it should be: https://yourorg.api.crm.dynamics.com/api/data/v9.1/$metadata You will see the metadata for this organization:  

Filtering Lookups in Dynamics 365 with addCustomFilter and addPreSearch

In Dynamics 365, we have the ability to filter lookups using addCustomFilter. To do this, we get the control we would like to filter, and add use: addCustomFilter(filter, entityLogicaName) Where: filter is a FetchXML string entityLogicaName is an optional parameter that implies the filter should only work for the entity provided Let’s say on opportunities all accounts are displayed: If we would like to filter these accounts to only show … Continue reading Filtering Lookups in Dynamics 365 with addCustomFilter and addPreSearch

USD – User Settings, ReadSetting, SaveSetting

In Unified Service Desk, there are user settings which can be referenced at run time. To set up user settings, go to Unified Service Desk->User Settings: Click New to add a setting: From here, enter the user that this setting should apply to, and a name and value: For example: Now, when you start USD, you will see the settings for this user under $Settings (this will not exist if … Continue reading USD – User Settings, ReadSetting, SaveSetting

Compare Dates in JavaScript

In JavaScript, there are ways to compare dates as well as methods that will not work. For example, if we have: var date1 = new Date(“2018-01-01 00:00”); var date2 = new Date(“2018-01-01 00:00”); if (date1 == date2) console.log(“equal”) else console.log(“not equal”) This will print: If we print both dates to the console, we will see they are exactly the same (note the date is different from what was supplied – … Continue reading Compare Dates in JavaScript

JavaScript Dates – new Date and UTC

In JavaScript, we can create a new date using: var date1 = new Date(“2018-01-01″); If we print this in the console, we actually get a different date: This is because we are omitting the time, so UTC time is assumed. To display the “correct” date, add the time: var date1 = new Date(“2018-01-01 00:00”); This produces:    

USD – ExecuteOnDataAvailable Action

In Unified Service Desk, the ExecuteOnDataAvailable action allows you to wait until data becomes available before executing a subaction. For example, let’s say we want to display a webpage of a map of a zip code if the contact’s zip code is populated. To do this, first confirm if the UII action ExecuteOnDataAvailable exists for your hosted control, and if not, create it: Next, create an action call. The ExecuteOnDataAvailable action … Continue reading USD – ExecuteOnDataAvailable Action

Dynamics 365 Timeout Settings

In Dynamics 365, we have the ability to configure timeout settings. Navigate to Settings->Administration->System Settings. You will see: Set session timeout Set inactivity timeout For Set session timeout, you can see there is a maximum session length, defaulting to 1,440 minutes (i.e. 24 hours). The minimum session length is 60 minutes. And, how long before the session expires do you want to show the timeout warning, defaulting to 20 minutes. For … Continue reading Dynamics 365 Timeout Settings

Using Browser Network Trace with Fiddler

When analyzing and troubleshooting network traces in browsers such as Edge, Chome, Firefox, and IE, you can export these and import them into Fiddler for further analysis. For example, let’s say you are working in Edge and are analyzing a REST API. You send a request through your browser to the API, that returns a list of customers: If you click F12 to open Developer Tools, you can see the request … Continue reading Using Browser Network Trace with Fiddler

Turning Off Dynamics 365 Error Report

In Dynamics 365, you may come across the error message below when using the application: “Microsoft Dynamics 365 has encountered an error. Please tell Microsoft about this problem. Microsoft Dynamics 365 has created an error report that you can send to help us improve the product. Microsoft respects the privacy of your personal information” You can turn this message off for users. To do this, go to Dynamics 365 Settings->Administration and … Continue reading Turning Off Dynamics 365 Error Report