How to Export the Audit History Values from Dynamics 365


Microsoft Dynamics 365 supports Audit Logging of various events. Authorized users can view the Audit History on any Dynamics 365 tables enabled for Auditing.

However, there is NO Export audit data function available from the Dynamics 365 Audit History or Audit Summary View.

The good news is that there is an out of the box option via Microsoft 365 Compliance’s Audit to Export the Dynamics 365 audit data including the Changed Values.

Here is an example from the Microsoft Dynamics 365 Audit History showing a Create and two Updates for “Test Contact 210409” record: Notice that there is NO option to export this data from the Dynamics 365 Contact’s Audit History view.

Now let’s look at this result from the Microsoft 365 compliance Audit Search on Dynamics 365 activities. Notice that there is the option to Download all results!

The Download is a CSV file. Notice that column D “AuditData” is in JSON format.

Excel has the option to transform/format the column JSON to regular Excel columns using Power Query Editor. Here is a link to the steps to format the exported audit log

After the transform and expansion of the AuditData columns. Then another level expansion of the AuditData.Fields column yielded the Audit History Field values in a pretty standard and easy to analyze Excel format:

Note: Dynamics 365 Audit Log data IS NOT immediately available in Microsoft 365 Compliance – takes up to 24 hours AFTER the event occurs for the corresponding audit log record to be returned

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

Posted in Dynamics 365 | Tagged , , | Leave a comment

How to visually tell between Common Data Service vs Common Data Service (current environment)


Microsoft Power Automate Flows support both Common Data Service and Common Data Service (current environment) connectors at the present time. The Common Data Service (current environment) connector is newer.

Both offer similar triggers and actions. Link to a good write up on the difference. Here is how to visually tell them apart to help properly setup the proper syntax/format.

Common Data Service icon has thinner line vs Common Data Service (current enviornment) which has bolder line

Common Data Service connector Triggers include “When a row is selected” – this is the trigger needed for Instant Cloud Flows. Triggers and Actions names use “record” instead of “row”

Common Data Service (current environment) connector Triggers include the flow step from a business process flow. Triggers and Actions names use “row” instead of “record” based on newer terminology

Contact me if you need some Microsoft Dynamics 365 CRM Sales Customer Engagement assistance.

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

Posted in Cloud Flow, Common Data Service, Dynamics 365, Power Automate, Power Platform, Workflow | Leave a comment

Power Automate Instant Cloud Flow in Dynamics 365 Solution


Microsoft Power Automate Instant Cloud Flow supports ON-Demand running from within Dynamics 365 such running an Instant Cloud Flow on the Account table record/row – similar to Dynamics 365 On-Demand Workflow.

Here is a good blog from D365 Demystified on steps to build an Instant Cloud Flow in Dynamics 365.

Some notes regarding Dynamics 365 CDS Connector, Solution, Security and Microsoft Power Automate Instant Cloud Flow based on 2020 release wave 2 (Server version: 9.2.21021.00144):

  • The “When a row is selected” trigger will display the Instant Cloud Flow in the associated Dynamics 365 Entity (Table is the new name going forward) such as the Accounts table
  • Power Automate Instant Cloud Flow CAN BE created outside of OR within a Solution – Flows created from either outside or inside a Solution will show up in the associated Dynamics 365 Table
    • An Instant Cloud Flow created outside of a Solution however CAN NOT be added to a Solution at this time, only an Instant Cloud Flow created FROM WITHIN a Solution CAN be added to another Solution. Add existing cloud flow to a Solution DOES NOT work for Instant Cloud Flow created outside of a Solution (other types of Flow such as Automated Cloud Flow is OK). Link to this limitation
    • There is the issue of UNABLE to Save As an Instant Cloud Flow created inside a Solution to another Solution – the Save As will save the copy of the Instant Cloud Flow OUTSIDE of a Solution
  • Instant Cloud Flow has ONLY TWO security levels – “Owners” or “Run only users
    • To limit specific Flows to only some Dynamics 365 users – ADD only those users as “Run only users” – THIS ONLY applies to Instant Cloud Flow that is created OUTSIDE of a Solution
    • Instant Cloud Flow that is created INSIDE of a Solution – will ignore the “Run only users” and be available to all Dynamics 365 users. There is an option to NOT Allow Running Flows based on Dynamics 365 Security Role settings (Security Role > Customization > Miscellaneous Privileges > Run Flows) but not at the individual specific Instant Cloud Flow level IF it was created INSIDE of a Solution
  • Power Automate My flows DOES NOT show ANY Instant Cloud Flows created inside a Solution
    • Instant Cloud Flows created inside a Solution show up within the Solution only

To SEE ALL the Power Automate Flows (Inside OR Outside a Solution) for an environment – use the Power Platform admin center

Select the Environment > click on the Resources and select Flows

This image has an empty alt attribute; its file name is image-42.png
This image has an empty alt attribute; its file name is image-43.png

Note: The Owners column value will be blank for Flows that are INSIDE a Solution.

Contact me if you need some Microsoft Dynamics 365 CRM Sales Customer Engagement assistance.

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

Posted in Dynamics 365, Power Automate, Workflow | Tagged , , , , , , , , , , | Leave a comment

How to Add SharePoint Document Files Tab to a Dynamics 365 Custom Table (Entity) Main Form


Microsoft Dynamics 365 Custom Table (Custom Entity) supports Document Management with SharePoint. The Main Form on the Custom Table (Custom Entity) however DOES NOT have the Files tab available by default.

The same setup also applies to adding the Files tab to Main Forms (if missing and not present by default) of out of the box Dynamics 365 tables (entities) that are enabled for Document Management.

Note: We will need to use the Microsoft Power Apps Form Designer to do this since the Dynamics 365 Legacy / Classic Solution Explorer DOES NOT have the option to setup the related Documents subgrid under the Files tab.

Here is how to add a SharePoint Document “Files” tab to a Document Management enabled Dynamics 365 Table (Entity).

Part 1 – Create the Files tab and add the Related Documents Subgrid

  • Open Power Apps > select the Dynamics 365 environment > open the Solution containing the custom entity main form to add the Files tab to

Note: For this example – we will use a custom table (entity) called “Company”

  • From the opened Solution > Open the custom entity > Open the Main Form to add the Files tab

Note: For this example – we will use the main form called “Information”

  • Add a 1 column tab and label it “Files” to the main form
  • Select this new tab and click to focus on the Section
  • Hide the Section label in this new “Files” tab
  • Add a Subgrid component to this new Files tab
  • Click on the “Show related records” and select the “Documents (Regarding)” for Table
  • The Default view is defaulted to “All SharePoint Document” and NOT editable from Power Apps Form Designer at this time. We will set this to “Document Associated Grid” default view via Customization XML at a later step – see Part 2 below

Note: “Document Associated Grid” is the default view behavior found in out of the box Files tab and related Documents view

  • Check the “Hide label” option for the Subgrid control
  • Check the “Allow users to change view” option
  • Check the “Show all views” option
  • Save and Publish the change
  • The Files tab is now functional except that it defaults to the “All SharePoint Document” and will NOT display the Document Location on the upper left corner below the view name. If this is OK – you can stop here. However, if you like to set the default view to “Document Associated Grid” – proceed to the next step – Part 2 Modify the Customization XML

Part 2 – Modifying the Customization XML to set Files tab default view to “Document Associated Grid

Note: Need to be extra careful when editing the Customization XML since it will be via UNmanaged Solution – changes are final. Be sure to test it out in a test environment first.

  • Open Power Apps > select the Dynamics 365 environment > Create a NEW Solution to contain only the updated main form component from Part 1 above AND NOTHING ELSE
  • Add the custom Table to this NEW Solution from above
  • Click on Select components and ONLY select the Main Form component with the Files tab from above
  • DO NOT include all components
  • DO NOT include table metadata
  • Export this solution as Unmanaged solution

  • Update the customizations.xml from the downloaded Unmanaged solution zip file
  • Search for the Subgrid control label name in the customizations.xml. Example above is labeled “New SG control 1614755864750
  • Replace the <ViewId> value A5B008AC-07D9-4554-8509-2C05767BFF51 with 0016F9F3-41CC-4276-9D11-04308D15858D. THIS IS THE ONLY CHANGE
  • Import the Unmanaged solution zip file and publish
"All SharePoint Document" view GUID (replace this value in the UNManaged Solution's Customizaton XML):

<ViewId>{A5B008AC-07D9-4554-8509-2C05767BFF51}</ViewId>

TO THIS "Document Associated Grid" view GUID:
<ViewId>{0016F9F3-41CC-4276-9D11-04308D15858D}</ViewId>

This was tested on:
Microsoft Dynamics 365 2020 release wave 2 enabled
Server version: 9.2.21014.00140
Client version: 1.4.2204-2101.4

Contact me if you need some Microsoft Dynamics 365 CRM Sales Customer Engagement assistance.

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

Posted in Customization, Document Management, Dynamics 365, Power Apps, SharePoint Integration, Unified Interface | Tagged , , , , , , , , , , , , , , , | Leave a comment

How to Update an Existing Dynamics 365 Custom Report RDL


Dynamics 365 supports custom reports built using SQL Server Reporting Services (SSRS) report definition language (RDL). When the situation calls for updating an existing Microsoft Dynamics 365 custom report (.RDL) but you no longer have access to the original code/solution – here is how to download and update the existing Microsoft Dynamics 365 custom report (.RDL):

First, download the existing Custom Report’s .RDL file using Microsoft Dynamics 365’s Advanced Find.

Use Advanced Find to look for “Reports

Select the existing Dynamics 365 CRM Report and click on Edit. Action > Download Report

Next step is to open Visual Studio that is setup for Microsoft Dynamics 365 Report writing/development

Create a new project based on the “Report Server Project” template

Right click on the “Reports” folder and Add an “Existing Item…”. Select the downloaded .RDL file from above step

Open (double-click) on the .RDL file and begin updating custom report in the “Design” tab

Click on the “Preview” tab to build the updated .RDL file.

The updated .RDL file is located in the Project directory. Use Advanced Find to edit the existing custom report and choose the updated .RDL file.

Contact me if you need some Microsoft Dynamics 365 CRM Sales Customer Engagement assistance.

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

Posted in BIDS Report Authoring Extension, Customization, Dynamics 365, Report | Tagged , , , , | Leave a comment

Dynamics 365 Configure Server Based SharePoint Integration Error – 403 Forbidden


Encountered this error while setting up the Microsoft Dynamics 365/CRM SharePoint Document Management – when trying to Enable Server-Based SharePoint Integration: Validation Status: Failed. Default Site Invalid. Dynamics 365 Configure Server Based SharePoint Integration Error – The remote server returned an error: 403 Forbidden.

<errorlog><sites>
  <site>
    <url>https://demo210111.sharepoint.com/sites/CRMTS01</url>
    <exception>The remote server returned an error: (403) Forbidden.</exception>
  </site>
</sites></errorlog>

This is due to the CRM User setting up the SharePoint integration needing the proper SharePoint Site permission in-addition to CRM security roles. Need to add the CRM User to the SharePoint Site with Edit Permission to resolve this error.

Re-ran and it is OK and no more error. Yay!

Link to Permissions required for document management tasks

Contact me if you need some Microsoft Dynamics 365 CRM Sales Customer Engagement assistance.

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

Posted in Document Management, Dynamics 365, SharePoint Integration, Troubleshooting | Leave a comment

Dynamics 365 Document Location Error – urloption is not defined


Encountered this error while setting up the Microsoft Dynamics 365/CRM SharePoint Document Management – Document Location “urloption is not defined

Here is the Error Details

ReferenceError: urloption is not defined
    at Object.mscrm.Form_onload (https://demo210111.crm.dynamics.com/%7b637464136700026442%7d/webresources/SharePointDocumentLocation_main_system_library.js:1:1380)
    at pl._executeFunctionInternal (https://demo210111.crm.dynamics.com/uclient/scripts/app.js?v=1.4.1967-2011.4:1142:3778)
    at pl.executeFunction (https://demo210111.crm.dynamics.com/uclient/scripts/app.js?v=1.4.1967-2011.4:1142:3524)
    at pl.execute (https://demo210111.crm.dynamics.com/uclient/scripts/app.js?v=1.4.1967-2011.4:1142:3339)
    at https://demo210111.crm.dynamics.com/uclient/scripts/app.js?v=1.4.1967-2011.4:110:21987
    at i (https://demo210111.crm.dynamics.com/uclient/scripts/app.js?v=1.4.1967-2011.4:235:88)
    at z._executeIndividualEvent (https://demo210111.crm.dynamics.com/uclient/scripts/app.js?v=1.4.1967-2011.4:110:21963)
    at z._executeEventHandler (https://demo210111.crm.dynamics.com/uclient/scripts/app.js?v=1.4.1967-2011.4:110:19076)
    at Object.execute (https://demo210111.crm.dynamics.com/uclient/scripts/app.js?v=1.4.1967-2011.4:110:16470)
    at w._executeSyncAction (https://demo210111.crm.dynamics.com/uclient/scripts/app.js?v=1.4.1967-2011.4:765:692)

This error is due to Server-Based SharePoint Integration is NOT enabled. Usually this is the first step in setting up the out of the box D365 SharePoint integration. Only encountered this error while trying out a “test environment” and unable to find anything on the error message.

To enable the Server-Based SharePoint Integration navigate to Power Platform admin center > Select the Dynamics 365 Environment > Settings > Integration > Document management settings > Enable Server-Based SharePoint Integration

Contact me if you need some Microsoft Dynamics 365 CRM Sales Customer Engagement assistance.

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

Posted in Document Management, Dynamics 365, Microsoft Dynamics CRM, Troubleshooting | Leave a comment

Business Process Flow Does NOT Appear on Some Existing Records


Encountered an existing CRM Account record that does NOT display a Specific Business Process Flow (BPF) after selecting the BPF via the Switch Process in either Unified Interface or legacy web client.

Checked the below items but issue still presists

  • Check that the BPF is active – OK
  • Check that the User has Security Privilege to the BPF – OK
  • Check that the Unified Interface App has the BPF enabled – OK
  • Check creating a new CRM Account record shows BPF – OK
  • Check other existing CRM Account records show BPF – OK

So the BPF is still NOT showing…some more trouble-shooting is needed! The BPF architecture changed in Microsoft Dynamics 365 from earlier versions which introduced a new entity for each new BPF activated. This entity tracks among other things every instances of the related CRM records with the corresponding BPF.

Somehow there was an existing entry in this BPF entity for the affected Account record NOT displaying the BPF. This was an old CRM Account record and perhaps got corrupted during the upgrade process to Microsoft Dynamics 365.

Solution was to delete this record from the BPF entity.

After clearing this – able select the BPF for the Account record and the BPF displayed OK afterwards. Also a new corresponding entry was created in the BPF entity.

Contact me if you need some Microsoft Dynamics 365 CRM Sales Customer Engagement assistance.

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

Posted in Business Process Flow, Dynamics 365, Troubleshooting | Leave a comment

Dynamics 365 Unified Interface JavaScript to Set a Date Field to Current Date


From recent working with Dynamics 365 customers transitioning to the new Unified Interface – have a CRM Sales User scenario that needs to set a CRM Contact field to the current date on a new record.  The user can then either keep the default current date or set it to another value before saving the new record.

We will need to use JavaScript to set a CRM date field via the Unified Interface or the CRM legacy web client.  The Dynamics 365 Business Rule does not offer a “Current Date” function at this time.  Also Dynamics 365 Workflow or Microsoft Power Automate will not be suitable since it needs the CRM record to be saved in-order to trigger setting a default value (even CRM Workflow running in Real-Time would not work in this case).

So here is the JavaScript – working for both the Unified Interface and CRM legacy web client:

var Sdk = window.Sdk || {};
(function () {
  this.setFieldCurrentDate = function (executionContext) {
    var formContext = executionContext.getFormContext();
    if(formContext.ui.getFormType()==1) {   // 1 is for new record create state
      var currentDate = new Date();
      formContext.getAttribute("birthdate").setValue(currentDate);
    }
  }
}).call(Sdk);


To setup the above JavaScript:

Add the above JavaScript to a Web Resource

image

Add the above Web Resource to the CRM Contact Form Main Library and add “Sdk.setFieldCurrentDate” to the Form Onload event.  Be sure to check on the “Pass execution context as first parameter”.  Publish the CRM Contact entity.

image
image

On a New CRM Contact Record – the Contact’s Birthday field is defaulted to today’s date:

image

 

Contact me if you need some Microsoft Dynamics 365 CRM Sales Customer Engagement assistance.

Frank Lee
12 times awarded Microsoft MVP – Dynamics 365 / CRM
San Francisco Bay Area | Silicon Valley

Posted in Dynamics 365, JavaScript, Unified Interface | Tagged , , , | Leave a comment

How To Uptake the new Service scheduling in your org


The Dynamics 365 legacy service scheduling is deprecated and will no longer be available on 10/1/2020, use the new Dynamics 365 Service Scheduling available in the Unified Interface. 

I had encountered the following issue during the setup of the new Service Scheduling in one of my existing Dynamics 365 Online environments – “Uptake the new Service scheduling in your org.  You can now use the new Service scheduling experience in Unified interface and leverage the power of Resources, Facilities/Equipment, Service Activities, Schedule board and more”

image

Here is how to resolve this “Uptake” in my Dynamics 365 Online environment:

  • Go to Power Platform admin center > Environments > select the Dynamics 365 Online environment  > click on the “…” and click on “Manage Solutions

image

  • Select the “Core Service Scheduling” solution and click on the “INSTALL” to install this solution

image

By installing the “Core Service Scheduling” solution – two new solutions were added to my Dynamics 365 Online environment: Universal Resource Scheduling and Core Service Scheduling

image

image

 

Now I can start the setup and begin using the new Dynamics 365 scheduling experience.  The new schedule board looks very nice – a good upgrade from the legacy service calendar.

Posted in CRM Online, customer service hub, Dynamics 365, Service Scheduling, Unified Interface | Tagged , , | Leave a comment