Show Loading Screen in Dynamics 365 using Client API reference

Suppose, you want to show a loading/waiting screen to let people know there’s some heavy processing going on in the back-end and they shouldn’t navigate away to do anything else with the record, you can use loading screen by using showProgressIndicator() and closeProgressIndicatory() methods.

Xrm.Utility methods

There are 2 methods are documented in the Xrm.Utility of Microsoft Docs that you can use to achieve this. Microsoft reference here.

In this scenario, let’s say you want to show the Loading page while your Action is being performed by the JavaScript code.

  1. You can place the Xrm.Utility.showProgressIndicator(message); before you begin your code to invoke an action and place Xrm.Utility.closeProgressIndicator(); in your success and failure messages.
    codePositions

Execution

Whenever your JS code will call the action, the progress message will be displayed on the screen as below  –

In Classic UI
clasicMessage

In Unified Interface –
UCIMessage

And once the process is complete, the Xrm.Utility.closeProgressIndicator will remove the message as below and bring back the form you were working on –

messageOver

Side Note: If you are using action calling from JS using invokeProcessAction, as of the day of this post – This doesn’t work well and results in action not supported error on the UCI – invokeProcessAction does not work in UCI

Hope this helps!

Advertisement

Global Notification in Dynamics 365 Unified Interface App [Preview]

Here’s a great feature to add a warning/error notification which is scoped globally unlike setFormNotification() which is commonly used and remains within a form itself.

Xrm.App.addGlobalNotification(notificationObject).then(success, error); serves this purpose. Let’s see how –

Disclaimer: Please be aware this is a preview feature yet and I’ll update on this post once this is out of preview.

This is only available for the Unified Interface.

Scenario

Let’s say you have opened an Account form and you want to warn the user in case they are working remotely with someone and might have their screen shared. You want to show a message like this –
globalNotif

And even if they navigate away from the form, it will remain on the screen since it’s scope is global.
navigatedOtherPlaces

Or, user can chose to close it manually which appears at the end of the strip on top-right corner.
canCloseIt

You can also optionally add a button and make it navigate to another URL in case you want to share more info with the users (In my example, I redirected to https://www.microsoft.com/en-in/) –
learnMoreButton

Example

Xrm.App has 2 methods to do the needful –

Xrm.App.addGlobalNotification(notificationObject).then(success, error) & Xrm.App.clearGlobalNotification(notificationObject).then(success, error)

In my scenario, I want to trigger the warning message as soon as the user wanders into one of the Account records. So, in my case, I’ve registered the method onLoad of the Account form itself.
Here’s the code in my JS file for the same –

Some notes before we proceed with the code –

  1. type in the notification object is supported as 2 at the moment and no other types are supported.
  2. The levels are as below
    1. Success
    2. Error
    3. Warning
    4. Information

account = {
globalNotification: function () {

var learnMoreAction =
{
actionLabel: “Learn more”,
eventHandler: function () {
Xrm.Navigation.openUrl(“https://microsoft.com”);
}
}
var notificationObj =
{
type: 2,
level: 3, //warning
message: “Please make sure you are not sharing your screen!”,
showCloseButton: true,
action: learnMoreAction
}

Xrm.App.addGlobalNotification(notificationObj).then(
function success(result) {
console.log(“Notification created with ID: ” + result);

// More code here
},
function (error) {
console.log(error.message);
// handle error here
}
);
}

};

I’ve registered the Function as account.globalNotification. You can directly use globalNotification is you are writing function directly as function globalNotification() {}

fnAdded

This notification remains App-wide unless closed by closed by a user of closed using clearGlobalNotification method as mentioned by Microsoft.

Source documentation by Microsoft is here – Xrm.App

Since we are transitioning into Unified Interface, here are some other related posts that you may like looking at –

  1. D365 Quick Tip: Why BPF wouldn’t appear in D365 Unified Interface?
  2. Fix Ribbon icons on the Unified Interface in D365 CE
  3. Change the Unified Interface App Icons
  4. Unified Interface App URLs – 3 different ways

Hope this helps!!

Store ‘Today’s Date’ in a field to use in workflow conditions in D365 CE

Most of us need this in our workflow conditions to check against – to have today’s date handy and then use them in If conditions in workflows. But, the filter in If conditions in workflows don’t let you dynamically select On or after ‘Today’.

And when you want to compare to today’s date on selection of On or After, you are forced to enter a date and not dynamically select Today.

onOrAfterBlank

To overcome this, here’s what you can do to simply store Today’s Date in all records.

Calculated Date and Time field

So workaround this, you can simply create a new Date and Time type of Calculated field to store the current date and use it in your workflow conditions or wherever you need it.
createCalculatedField

Make sure the type of the field is Calculated and then, Edit the criteria.

Select Now() function to set the value of the field.
Now
And the final criteria condition will simply look like the below
finalCriteria

Once you save and publish all your changes, you’ll see that the field is automatically populated with today’s date.
allDatesPopulated.png

Using in Workflow Conditions

Now, you can use the same in the workflow conditions as shown below –

addedCriteria

and you should be able to use this in your workflow conditions which could look like this

addedOnCondition

Hope this quick workaround comes handy!

 

 

Qualify Lead in D365 CE: Select which entity records should be created

Wave 2019 Updates brought some really sought-after features. Another one which I would like to bring up is the Lead Qualification experience.

I’ve written this post when I enabled the Early Opt-in of Wave 2 Oct 2019 Updates. To enable Early Opt-in, please refer this post – Early Opt-in for October 2019 Wave 2 Updates

This is set to release for the Oct 2019 Updates.

Default Behavior

So when you Qualify Lead by default – Account, Contact and Opportunity records are created.
fullQualifyLead

Notice that by default, the created Account and Contact are always auto-filled.
all3Records

Lead Qualify Experience in System Settings

By default, D365 will let you create all three – Account, Contact and Opportunity records when you Qualify a Lead.
originalSetting

When you select No, you’ll be asked which all entities should be created when you Qualify a Lead.
selectNo

 

Lead Qualification for selected entities

No, when you click on Qualify button, you’ll be treated with this Dialog box where you can choose what records should be created.

I’ll select only Opportunity this time
selectWhichOnes

 

And only Opportunity will be created and notice that the Contact and Account are blank this time.
blankOpp

Hope this is useful!

Thanks.

Related Blog on one of Wave 2 2019 Update: Customize Opportunity Close dialog box in D365 CE v9 Unified Interface – Wave 2 update

I’m also listed on the Top 100 CRM Blogs and Websites on Feedspot. It has a curated list of awesome bloggers.

D365 PSA: Delegated Resource gets error on making time entries for another Resource

Have you been added as a Delegate for a fellow colleague but not able to Read, Create or Submit Time Entries on their behalf?

Let’s see what you are missing.

Before that, if you want to learn about Delegations in D365 PSA, check this Delegating Time Entries in PSA

Scenario

William Contoso wants to make Veronica Quek as his Delegate and let her enter time on his behalf. So William created a Delegate record for Veronica.
delegateAdded

Error for the Delegate Resource

Now, Veronica is attempting to do time entries for William by going to Time Entry Calendar view and switching the user to William.

  1. And when Veronica wants to enter time as William, she’d switch to the User on the Time Entries Calendar View like this –
    switchUser
  2. But, see this error and she don’t know what the issue might be. Even though she’s the Delegate!
    error

Missing Security Role

Yes, this is the first thing you should check

  1. Veronica Quek is missing a Delegate Security Role in PSA to be able to make time entries on behalf of other users.
    Assign Delegate security role to the user to make them enter time on behalf of others.
    securityDelegate

Hoping this is quick fix for you. 🙂