Blocked Emails in Dynamics 365

Sean Roque, 04 March 2021

When tracking email activities in Dynamics 365 via Dynamics 365 App for Outlook, you may have encountered this error message “This Email has been blocked due to potentially harmful content” in the past:

image

Recently, Microsoft has added the SecuritySettingforEmail property into OrgDbOrgSettings which can be toggled to edit or remove this message.

image

All we need to do is update the value to 3 (default is set to 1) and the warning message is a thing of the past.

The question is, how do we update this value?

You can find articles online that describe how you can install and use this tool, but if you are already a User of XrmToolBox, then there’s an even easier method that does not require an extra installation.

Updating OrgDbOrgSettings using XrmToolBox

1. In the XrmToolBox tool library, you can find and install the Org Settings Updater tool.

image

2. Then all you need to do is simply Connect to your target environment > Open the tool > Enter “SecuritySettingForEmail” in the search bar >

image

3. Enter 3 under the “New Value” field > Click “Commit to <Environment Name>”. If you click Refresh, you can see that your updated value is now reflected in the Current Value for the setting.

image

4. After doing this, refresh any instance of Dynamics 365 you have open in a browser and you will not see the error message anymore.

An alternative on updating this value without using XrmToolBox is using the Web API to update this directly using your browser’s developer tools.

Updating OrgDbOrgSettings using Web API

OrgDbOrgSettings is a property of the Organization entity, so an option is to call Xrm.WebApi.updateRecord() to update this directly.

To do this:

1. open an instance of Dynamics 365 and press F12 (Firefox, Edge, Chrome to name a few that support this) to open your browser’s developer tools.

2. Then in Console, apply the below entry after editing the highlighted areas specific to your organization:

var data =

{

"orgdborgsettings" : "<OrgSettings><IsCommandingModifiedOnEnabled>true</IsCommandingModifiedOnEnabled><EnableActivitiesTimeLinePerfImprovement>1</EnableActivitiesTimeLinePerfImprovement><EnableActivitiesFeatures>1</EnableActivitiesFeatures><CanCreateApplicationStubUser>false</CanCreateApplicationStubUser><AllowRoleAssignmentOnDisabledUsers>false</AllowRoleAssignmentOnDisabledUsers><SecuritySettingForEmail>3</SecuritySettingForEmail></OrgSettings>"

}

Xrm.WebApi.online.updateRecord("organization", "<ENTER ORG GUID HERE>", data).then(

function success(result){

console.log("Organization Updated");

},

function (error){

console.log(error.message);

}

);

You will need to get your organization id which can be found under Advanced Settings > Settings > Customization > Developer Resources. Then, use this string to replace the “<ENTER ORG GUID HERE>” entry.

image

3. For setting the value of “orgdborgsettings” we want to make sure that we are keeping your organization’s existing properties the same, while adding new/updating the SecuritySettingForEmail value. To get the existing value, run the following in console:

Xrm.WebApi.retrieveRecord("organization", "<ENTER ORG GUID HERE>").then(

function success(result) {

console.log("Retrieved values: orgdborgsettings: " + result.orgdborgsettings);

},

function (error) {

console.log(error.message);

}

);

4. Once you have the current value of orgdborgsettings, you can edit and set this to the value of “data” in the first code snippet.

image

<OrgSettings><EnableActivitiesTimeLinePerfImprovement>1</EnableActivitiesTimeLinePerfImprovement><EnableActivitiesFeatures>1</EnableActivitiesFeatures><IsCommandingModifiedOnEnabled>true</IsCommandingModifiedOnEnabled><CanCreateApplicationStubUser>false</CanCreateApplicationStubUser><AllowRoleAssignmentOnDisabledUsers>false</AllowRoleAssignmentOnDisabledUsers><SecuritySettingForEmail>3</SecuritySettingForEmail></OrgSettings>