Duration field in Dynamics 365 converts Hours value to Days in Dynamics 365 | [Flow Workaround to convert in Hours and Mins]

This must be one of the most common scenarios Dynamics 365 Users must’ve come across. The Whole Number’s Duration field shows Duration in Days once it crosses 24 hours, it shows the Duration in Days. Like below –

And once you leave the control, it’ll be converted to it’s equivalent Days conversion

But if you click on it, you can in fact see the Hours

However, It’s not ideal to click on the field and check the Hours on the form. Also, this doesn’t work in case the field is seem from a View on the entity. Unfortunately, we can’t change this behavior. So, to have a workaround, I created a new field to store the translated value.

Hope this implementation is useful to you. In case of any better ideas, kindly suggest in the comments and I’ll be happy to update this post in order to serve full purpose. ūüėä
To understand the core conversion using long division, refer this post – https://www.calculatorsoup.com/calculators/conversions/minutes-to-hours.php

New Single Line of Text Field and a Flow

Let’s look at how the implementation is –

We’ll need to also review the following Logic Apps’ Math Functions to understand how to apply them – https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#math-functions?WT.mc_id=DX-MVP-5003911

Also, to understand how to read data from triggerOutputs(), check this post РUsing triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate

  1. I’ve created a new Single Line of Text field called as Time In Hours (cf_timeinhours) which will hold the translated Hours & Minutes. Making the field as Read-Only is recommended so that no one changes it on the form post update.


  2. Now, here’s a Flow (You can configure it either on demand for existing records of on Create/Update of the Duration field which itself to calculate once the value is changed field). Just for example’s sake, my field is on Contact and hence, I’m triggering the Flow on Update of the contact on the change of the Avg Turnaround Time (Whole Number of format Duration) field.


    See, that the Body of the step will have the Avg Turnaround Time field storing the duration in minutes.


  3. First actions is to use Divide to get the Hours. I’m creating a variable called as Divide To Get Hours of type Float.


    Here’s how the div function included above looks like –



    Formula is: div(triggerOutputs()?['body/cf_avgturnaroundtime'],60)
    Explanation: Duration field in Dynamics 365 stores Minutes. First, we divide these minutes by 60 to get the Hours value.
    If you divide 3375/60, you get 56.25. But the Div will give you the Integer value. (The right way to divide to get exact float is to also store the 60 in a variable and then work with variables. See this post https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-receive-decimal-number-result-after-dividing/td-p/195399) However, in this case, we anyway need to 56 part, so this is fine for now.

  4. Next, we’ll multiply the result of the Hours we got from the step above i.e. Divide to Get Hours.


    Here’s how the Mul function looks –


    Formula is: mul(60,int(variables('Divide to Get Hours')))
    Explanation: Now, we multiple the result of the Divide to Get Hours. This will be used to subtract from the actual value of Avg Turnaround Time field.
    Here, we multiple 60 x 56 = 3360 and get 3360

  5. Finally, to get Minutes, we use the third variable that uses a Sub function


    The Sub function looks like below –


    Formula is: sub(triggerOutputs()?['body/cf_avgturnaroundtime'], variables('Number to Subtract From'))
    Explanation: Now, we subtract the result of the Number To Subtract step from the value of the Duration field i.e. Avg Turnaround Time field itself. These will be the minutes.
    Now, to get the minutes we subtract the result of the Number to Subtract from the actual minutes value of the duration field i.e. 3375 – 3360 = 15. These are your minutes!


  6. Final step is to simply arrange it in a String (you can also form the string elsewhere directly and skip the below)

  7. And to make sense of this conversion, I’ll update the field on the record to show what the converted Hours and Minutes is.

  8. Here’s the final result once the Flow runs successfully.

Hope this helps! You might always want to check more Power Automate / Dynamics 365 posts –

  1. Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
  2. FormatDateTime function in a Flow | Power Automate
  3. Formatting Approvals’ Details in Cloud Flows | Power Automate
  4. Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
  5. Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
  6. InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip
  7. Store ‚ÄėToday‚Äôs Date‚Äô in a field to use in workflow conditions in D365¬†CE
  8. Create a Team, add Members in Microsoft Teams upon Project and Team Members creation in PSA / Project Operations | Power Automate
  9. Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip
  10. Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
  11. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  12. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists

Thank you!

Use Rich-Text Control for Multiple Lines of Text in Dynamics 365 CE | Quick Tip

With the addition of the Rich Text Control, your Multiple Lines of Text field can make a lot more sense than before.

Standard Control

Your usual control for Multiple Lines of Text looks like this

Rich Text Control

Now, you can turn this into a Rich Text Editor
Here’s how you do it –

  1. Go to the Multiple Lines of Text field, in this case, Description field.
    select the inner control and click on Properties


  2. Now, look for Controls tab and click on Add Control as shown below

  3. Look for Rich Text Editor Control

  4. Make sure you select the new Control on all formats (or wherever you want to apply)

  5. Once you apply changes and publish, the new Control will be available for you to use.


Hope this was useful. Here are some more Dynamic 365 posts which you might want to check –

  1. Ribbon button visibility based on a field value in Dynamics 365 | Ribbon Workbench
  2. Get GUID of the current View in Dynamics 365 CRM JS from ribbon button | Ribbon Workbench
  3. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  4. Find deprecated JS code used in your Dynamics 365 environment | Dynamics 365 v9 JS Validator tool | XrmToolBox
  5. Remove ‚ÄėThis Email has been blocked due to potentially harmful content.‚Äô message in Dynamics 365 Emails | OrgDbSettings¬†utility
  6. Track and Set Regarding are disabled for Appointments in Dynamics 365 App For Outlook message | Demystified
  7. Mailbox Alerts Hide/Show behavior in Dynamics 365 CRM
  8. Dynamics 365 App For Outlook missing on SiteMap in CRM? Use shortcut link [Quick Tip]
  9. Pass Execution Context to JS Script function as a parameter from a Ribbon button in Dynamics 365 | Ribbon Workbench
  10. Find Created On date of solution components in Solution Layers | Dynamics 365 [Quick Tip]

Thank you!

Remove ‘This Email has been blocked due to potentially harmful content.’ message in Dynamics 365 Emails | OrgDbSettings utility

It’s annoying to see this message on every email you Track in Dynamics 365 and just how it takes all the critical space on your timeline instead of showing you the actual email message.


Let’s look at how we can disable it using OrgDbSettings tool.

Note: I wouldn’t recommended to do these changes since we are looking to by-pass security flags dictated by Microsoft for your Org. However, if you really need to so, make sure you’ve backed up your Org before proceeding.

OrgDbSettings Editor Tool [Managed Solution]

You can download OrgDbSettings Managed Solution Utility from here – https://github.com/seanmcne/OrgDbOrgSettings

The link highlighted above is where the Releases are: https://github.com/seanmcne/OrgDbOrgSettings/releases

Once you download the Managed Solution, import it in your Org

  1. Once Imported in Dynamics, it appears like this in Solutions. Open it up.


  2. In the solution, look for SecuritySettingForEmail. Click once on the row to reveal the Description at the bottom, you’ll see the legends of what each value means.
    It’s defaulted to 1, meaning, you’ll see the warning which is what we want to hide.


  3. Next, double click on the Row and on the 1 which is the Default value as shown below.

  4. It’ll open up a Dialog to set your value of choice. In our case, we can to hide it, so I’ll put the value 3 and click on Update as shown below.

  5. It’ll update in a few seconds and you can refresh and see, the warning will be gone.



Hope this is helpful! Here are some more Dynamics 365 CE related posts you might want to check –

  1. Get GUID of the current View in Dynamics 365 CRM JS from ribbon button | Ribbon Workbench
  2. Get Dynamics 365 field metadata in a Canvas App using DataSourceInfo function | Common Data Service
  3. Dynamics 365 App For Outlook missing on SiteMap in CRM? Use shortcut link [Quick Tip]
  4. Pass Execution Context to JS Script function as a parameter from a Ribbon button in Dynamics 365 | Ribbon Workbench
  5. Find Created On date of solution components in Solution Layers | Dynamics 365 [Quick Tip]
  6. Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]
  7. Add multiple Opportunity Products at once in Dynamics 365 Sales | Enhanced Experience [Preview]
  8. Mailbox Alerts Hide/Show behavior in Dynamics 365 CRM
  9. Excel Importing Notes (Annotation) entity in Dynamics 365 CRM
  10. Dynamics 365 PSA v2 to v3 Upgrade failed? Here‚Äôs what to do.

Thank you!!

Find Created On date of solution components in Solution Layers | Dynamics 365 [Quick Tip]

If you’ve been using classic CRM since 2011 days until Solutions History came out (around 2018 timeline), we always wondered when was a certain field, view, form (component in general) was created.

It’s possible to see using Solution Layers

Example: When was a field created

Let’s say you want to find out when a field was created.

  1. Select the field, check for Solution Layer as shown below

  2. Now, go into the Active layer

  3. In Active layer, scroll down to the details

  4. You’ll be able to see the Created On field

  5. If there was a component/field that is too old and was created before this feature was introduced, it’ll show a default 1900 DateTime value

Looking elsewhere

I tried to look for this info in XrmToolBox’s Metadata Browser but couldn’t find it –

Please let me know if any better suggestions as well! ūüôā

Here are some more Dynamics 365 CE / CRM related posts you might want to check –

  1. Dynamics 365 Solutions History ‚Äď Keep track of your¬†deployments
  2. Using ‚ÄėClone a Patch‚Äô & ‚ÄėClone Solution‚Äô in Dynamics 365¬†Solutions
  3. Add multiple Opportunity Products at once in Dynamics 365 Sales | Enhanced Experience [Preview]
  4. Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]
  5. Mailbox Alerts Hide/Show behavior in Dynamics 365 CRM
  6. Excel Importing Notes (Annotation) entity in Dynamics 365 CRM
  7. Dynamics 365 PSA v2 to v3 Upgrade failed? Here’s what to do.
  8. Dynamics 365 Solutions’ New Experience in Power Apps, Solution Checker and more
  9. Check Managed Solution failures in Solution History in Dynamics 365 CRM
  10. Store ‚ÄėToday‚Äôs Date‚Äô in a field to use in workflow conditions in D365¬†CE

Hope this was useful

Change Booking Status colors on Schedule Board for Field Service/PSA [Quick Tip]

Here’s a Quick Tip for everyone using Field Service and Project Service Automation. In case you are wondering how can you change the colors of the Booking Statuses on the Schedule Board for Field Service and PSA, here’s what you need to do.

Default Colors

This what your default Schedule Board looks like out-of-the-box.

Booking Statuses

Booking Status is an entity within which you can set this up.
You can navigate to Booking Statuses entity in your Field Service like below

There are these records you can modify. Also, for PSA, you have the same entity with different records for Booking Statuses
But, let’s look at Field Service’s example –

Now in each record, you can see in Common tab

And you can change by selecting this color picker control

And save the new selected color.

And let’s change for Completed as well, just another example – changed for Completed also to a greenish shade

Updated Colors

Now let’s look at the updated Schedule Board of how these colors look.

Hope this quick tip helps!

Here are some more PSA/Field Service posts you might want to look at –

  1. How to add Rating Values to Rating Models in D365 Field Service and PSA
  2. Why we see Cross Day in Work Hours on Bookable Resources/User?
  3. Modify Project tab‚Äôs view in Schedule Board in PSA v3 | Quick Tip
  4. Dynamics 365 PSA v2 to v3 Upgrade failed? Here‚Äôs what to do.
  5. Additional columns in PSA v3 Schedule view
  6. Update Price feature in D365 PSA v3
  7. A manager is required for non-project time entries, absence, and vacation error in D365 PSA v3
  8. Set Work Hours Template to a Bookable Resource in D365 PSA v3
  9. Booking Resources more than their capacity in D365 PSA v3
  10. PSA v3 View Custom Controls used on Project form

Thanks!

Add multiple Opportunity Products at once in Dynamics 365 Sales | Enhanced Experience [Preview]

Very easy tweak but this will save loads of your time. One of the most important asks by Salespeople is perhaps this – “Add multiple Products on Opportunity at once!

Here’s how you can do this –

Classic Experience

In current/classic experience, if you open Opportunity Lines and go on to add a Product as below –

It’ll either open in a New form.

This isn’t intuitive. You definitely need better experience.

Enhanced Experience

In System Settings, under Sales, you’ll need to enable the Adding Products to Yes. This will enable the enhanced experience.

  1. Now, when you click on Add Products in the Opportunity’s Product Line Items tab, you’ll see a Quick Create Form like form on which you can Add Multiple Products in one go.


    And then go to + Add products


  2. Now, a Quick Create form will appear on which you can select multiple products

  3. Now, when you click on any + sign in blue, you can directly enter what quantity you want to add.
  4. Also, if you go to the Selected section which indicated how many unique products you’ve added, you’ll be able to remove the added Products in case you don’t want them


    and then Delete the same if needed.

  5. Now, let’s say I have this finally and when I click on Add to Opportunity, they get added as Opportunity Lines


    And they appear as below

    Hope this helps!!

Here are some more D365 For Sales articles you might want to check out –

  1. Kanban view in Dynamics 365 Sales | 2020 Wave 1 Early Access Feature
  2. Territories enabled for OOB Hierarchical relationship in Sales Hub
  3. Create your own Insight Cards with Power Automate in Sales Insights
  4. Discount Settings for D365 Sales Line Items ‚Äď Line Items or Per Unit?
  5. Talking Points in D365 AI For Sales
  6. Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]
  7. Contextual Email communication in D365 CE Wave 2
  8. Customize Opportunity Close dialog box in D365 CE v9 Unified Interface ‚Äď Wave 2 update
  9. Create & Send PDFs from Word Templates for Quotes in D365 CE Wave 2 Updates
  10. Save generated PDFs to SharePoint directly ‚Äď 2020 Wave 1 | Early Access Feature

Thanks!

Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]

This is one of the most common scenarios where you want to import an entity’s data in Dynamics 365 that has reference to some other entity. And the Lookup’s data is not yet created resulting in the Lookup reference missing. Just like below –

undefined

And resulting into the below –
undefined

And similarly while importing Contacts, the Account might not be already imported. And you get the error ‘The lookup reference could not be resolved

Most common scenario in Dynamics 365 implementations is importing Accounts and Contacts. The Primary Contact tried to lookup an already existing Contact and hence, fails.

Approach

Now, in order to handle such scenario, best and the most simple way is to import this together!

  1. Select both files and add them to a zip file –
    undefined
  2. Name it something appropriate
    undefined
  3. And import this in the Import Wizard in Dynamics 365 CRM.
    undefined
  4. You’ll see the files being included in the zip you selected.
    undefined
  5. After you review your mappings, you can confirm and Submit for Import.
    undefined
  6. There will be 2 jobs submitted and hence, 2 Imports will be created.
    undefined


Result

Now, if you check, both the Lookup references will be maintained.
Account will have the created Contact filled in Primary Contact and Contact record will have Account mapped in the Company Name field (or as per your mappings.)

undefined

In case you might want to look at some more Dynamics 365 CRM posts, you can check below –

  1. Mailbox Alerts Hide/Show behavior in Dynamics 365 CRM
  2. Dynamics 365 PSA v2 to v3 Upgrade failed? Here’s what to do.
  3. Refresh button missing on Roll-Up fields in D365 UCI? Quick Tip.
  4. Store ‚ÄėToday‚Äôs Date‚Äô in a field to use in workflow conditions in D365¬†CE
  5. Excel Importing Notes (Annotation) entity in Dynamics 365 CRM
  6. Kanban view in Dynamics 365 Sales | 2020 Wave 1 Early Access Feature
  7. Time/Expense Entry Rejection comments in D365 PSA v3
  8. Custom View Filter JS code not working in Dynamics 365 CE. Why? [Quick Tip]
  9. Show Loading Screen in Dynamics 365 using Client API reference
  10. Accessing multiple occurrences of a field in Business Process Flow using JS in D365 CRM

Hope this helps!

Excel Importing Notes (Annotation) entity in Dynamics 365 CRM

Preparing an Excel Template for Notes entity is a little tricky. Doesn’t work when you just Export directly as a Template from the Templates Wizard and try to include all columns and import as is. Why? Because there’s no Regarding field exported when you export/import that template.

undefined

Here’s what you can do as a workaround.

Scenario

Now, let’s assume you want to Export a standard Excel Template for import so that you can re-import into Dynamics for Notes entity for a regarding entity.

Exporting Excel Template

Your Document Templates are where all your Excel Templates can be exported from –

Now, follow the below –

  1. Select Notes entity and Edit Columns you need to Export the Excel with your required columns

  2. Select the columns you need. Observe that you don’t get Regarding column to export


  3. Then Download the file.

Modifying the Excel

Now, since you don’t have the Regarding field in the Excel you exported from Templates, here’s what you need to do –

  1. Add a column yourself, give it a proper name based on what the Notes’ Parent entity should be. In this example, I’m importing Notes for Account. So, I’m adding a column called ‘Account Name’


  2. A new column will be created as below

  3. Now, populate your data based on how the Notes should be imported and tagged to which records.

  4. Now, by default, this template is exported in Microsoft Excel Worksheet (xlsx) format. You’ll need to Save As in CSV format

Re-Importing

Up until above, your Excel is ready to be imported. Let’s begin –

  1. Import the file as a usual Excel Import in Dynamics 365 CRM. Since this is not a direct Template importing as is, but a CSV, you’ll get to map this file manually.
    undefined

  2. Then, you’ll need to manually select the Note entity from the drop-down and then proceed
    undefined

  3. Now, whatever is mapped automatically will be mapped. For the newly created Account Name field, you’ll need to expand the Not Mapped dropdown and select Regarding (Lookup)
    undefined
  4. Now, you’ll need to select the entity you want the Notes to appear under. In my case, this is Accounts, so I have it right there
    undefined
  5. Since this Regarding fields supports several entities, scroll all the way down to Confirm your selection
    undefined

  6. Now, your Regarding field is set and you are ready to confirm and Import
    undefined
  7. Now, my Import here is completed. (You’ll need to take care the Import is successful)
    undefined

Imported Notes

If you look at the records now, the Notes will be attached to the respective Regarding records
undefined
undefined

Here are some more posts on D365 CE you might want to look at –

  1. Pass selected rows‚Äô GUIDs to ribbon button in D365 | Ribbon Workbench
  2. Refresh button missing on Roll-Up fields in D365 UCI? Quick Tip.
  3. Check Managed Solution failures in Solution History in D365 CE
  4. Button Flow in Power Automate to replicate a Quick Create Form in D365 CE
  5. Create a support Queue in D365 CE
  6. What is ‚ÄúDoes not support untyped value in non-open type‚ÄĚ ODataException in creating records in D365 CE?
  7. Set Lookups in Xrm.WebApi D365 v9 correctly. Solving ‚ÄėUndeclared Property‚Äô error
  8. Set Work Hours Template to a Bookable Resource in D365 PSA v3
  9. Modified By (Delegate) & Created By (Delegate) in D365
  10. Qualify Lead in D365 CE: Select which entity records should be created

Hope this helps!!

Modify Project tab’s view in Schedule Board in PSA v3 | Quick Tip

Most common asks on Schedule Board in D365 PSA is about how we can modify the Project tab view we see?

actualTabShown

Resource Requirement Entity

The Resource Requirement entity is what controls what views are available for you on the Schedule Board –

  1. To be able to find what this view is about, you’ll need to go to the Resource Requirement entity
    viewLocated
  2. Now, if I open this record, you can make changes to this view. In this case, I now got Type and Status next to Name field and pushed Created On a little further.
    modifiedPart
  3. Now, just Save and Publish.

Project Tab view

Now, simply refresh Schedule Board and you’ll see the updated change –
updated

If you’re looking for more PSA related posts, you can check these –

  1. Dynamics 365 PSA v2 to v3 Upgrade failed? Here’s what to do.
  2. Additional columns in PSA v3 Schedule view
  3. Update Price feature in D365 PSA v3
  4. A manager is required for non-project time entries, absence, and vacation error in D365 PSA v3
  5. PSA v3 View Custom Controls used on Project form
  6. Set Work Hours Template to a Bookable Resource in D365 PSA v3
  7. Time/Expense Entry Rejection comments in D365 PSA v3
  8. Booking Resources more than their capacity in D365 PSA v3

Hope this quick tip helps!!!

Dynamics 365 PSA v2 to v3 Upgrade failed? Here’s what to do.

This is a little tricky upgrade from PSA v2 to PSA v3. I’m sure by this time of the year, most of you must have upgraded and this post by me comes a little late than it should.

Here’s my experience and what help from Microsoft Support I needed to complete the Upgrade successfully.

So usually, this is what you expect when you initiate the upgrade process. You go to the Instance Picker from Dynamics 365 Admin Center.
upgradeButton

And you can see that you are on PSA v2.4.x version and the New version available is 3.10.x. When you kick off, it starts running
upgradeInProgress
But, it fails like this.
installFailed

Let’s take a stab at it!

I usually prefer to go with the old school classic Instance Picker, if you want to have a quick access to it, check this post –¬†D365 Admin Center: Instance Picker Link

Solution Health Hub

Note: Please be aware that below mentioned steps that involve Project Service & Project Service Upgrade Rule Set can only be provisioned by Microsoft Support and we need to create a Support Request with Microsoft for them to provide this Rule Set. These comes in a Managed Solution Microsoft Support installs from their end into your environment.

  1. Assuming Microsoft Support has enabled this Rule Set for your organization, you can go to Solution Health Hub
    createNewAnalysisJob
  2. Then, select either Project Service or Project Service Upgrade
    ruleSet
  3. It will automatically run asynchronously as and when you create it. It should display results in a few moments.
    failedValidation
    In this case, my failures were that Resource Requirement records didn’t have Hours & Resources were not filled in. Some Project Tasks didn’t have Project attached to them which resulted in corrupted PSA data according to the Rule Set and hence, the upgrade fails.
  4. Now, in my case, I cleaned this data manually. Post that, I created another Analysis Job to ensure that there are no more failures.
    passedRuleSet
    Also, there’s another Rule that isn’t mentioned here but is a reason for failure. That is – Project Name (msdyn_Subject) should NOT be Blank. Use Advanced Find to find these records and correct manually.¬† Please ensure this manually as it won’t appear here.¬†
  5. Now, there’s a workflow called as Update User Work History.¬†It should have shown 3.3 or higher in the version to select, unfortunately, this will come once the upgrade fails 1 time.
    oldWF
  6. Now, you are all set to kick off Upgrade Once again. It will fail due to the incorrect workflow mentioned above in #5.
    installFailed
  7. Now, you can go back and check that workflow, it should have the correct version appearing (due to the partial upgrade that happened in #6 above, which eventually failed)
    updateUserWorkHours
    Set this to 3.3 and Activate the workflow again.
  8. Now, trigger the Update to PSA v3 one more time. And this time it should go through correctly.
    installedPlease note, due to constant upgrades in the platform/PSA, there could still be some undetected issues which could result in failure. Hence, I tried to put what I experienced in general.

    Post this, also ensure that all SDK Message Process Steps and related Workflows related to PSA are enabled.

In case you are also looking to find out about dependencies about failed Solution Upgrades, you can check this post too –¬†Check Managed Solution failures in Solution History in D365 CE

Hope this helps!