Plugin on AddListMembers message. When does it fire?

In one of our recent implementations involving marketing list entity, we were analysing the AddListMembers message for it.

We registered a plugin on AddListMembers message and below were our findings.

  • Dynamics Marketing List – The plugin didn’t trigger.
  • Static Marketing List – The plugin didn’t trigger for “Add using Lookup“. It only triggered for “Add using Advanced Find” when “Add only the selected members to the marketing list” option was selected. It didn’t trigger for “Add all the members returned by the search to the marketing list

 

This slideshow requires JavaScript.

So basically, we need to be very careful while implementing a plugin on AddListMembers message.

Hope it helps..

Using MediaWiki API for Showing content of Wikipedia page inside Dynamics 365 form

Hi,

Recently we had a requirement to show content of Wikipedia page and display it inside CRM in one of the entities form.

For this purpose, we can make use of “MediaWiki web service API.”

https://www.mediawiki.org/wiki/API:Main_page

To create the query, we can use the below tool

https://en.wikipedia.org/wiki/Special%3aApiSandbox

The html source code


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript">

function SetWikiContent() {

// get country name from crm form
if (Xrm.Page.getAttribute("new_name") != null) {

var title = Xrm.Page.getAttribute("new_name").getValue();

// set the url
var url = "https://en.wikipedia.org/w/api.php?format=json&action=parse&page=" + title + "&prop=text&section=0&callback=?";

$.getJSON(url, function (data) {
for (text in data.parse.text) {
var text = data.parse.text[text].split("
");
var pText = "";

for (p in text) {
//Remove html comment
text[p] = text[p].split("<!--");
if (text[p].length > 1) {
text[p][0] = text[p][0].split(/\r\n|\r|\n/);
text[p][0] = text[p][0][0];
text[p][0] += "
 ";
}
text[p] = text[p][0];

//Construct a string from paragraphs
if (text[p].indexOf("
") == text[p].length - 5) {
var htmlStrip = text[p].replace(/<(?:.|\n)*?>/gm, '') //Remove HTML
var splitNewline = htmlStrip.split(/\r\n|\r|\n/); //Split on newlines
for (newline in splitNewline) {
if (splitNewline[newline].substring(0, 11) != "Cite error:") {
pText += splitNewline[newline];
pText += "\n";
}
}
}
}
pText = pText.substring(0, pText.length - 2); //Remove extra newline
pText = pText.replace(/\[\d+\]/g, ""); //Remove reference tags (e.x. [1], [4], etc)

Xrm.Page.getAttribute('new_wikiinfo').setValue(pText);
}
});
}
}

</script>
</head>
<body onload="SetWikiContent();">
</body>
</html>

The helpful article

http://stackoverflow.com/questions/8555320/is-there-a-clean-wikipedia-api-just-for-retrieve-content-summary

Hope it helps..

Using Lookup, LookupSet and Multilookup function in SSRS (Dynamics 365)

Using the Lookup, LookupSet and Multilookup functions we can basically combine values from 2 different data set.

The definition of them are

Lookup/LookupSet/Multilookup(source_expression, destination_expression, result_expression, dataset)

source expression – the field from the source data set (for e.g. primary key)

destination expression – the field to be matched from the destination dataset (sort of foreign key)

result expression – the field whose value has to be returned from the destination dataset

dataset – destination dataset name.

For e.g. we have custom entity Team and Team Members (1 à n)

We have following two DataSet one for Team and one for Team Members.

  1. DSTeam

  1. DSPlayer

The sample report has the Tablix which is bound to DSTeam and has two columns one which is bound new_name field of DSTeam dataset and the second column which gets the player name from DSPlayer dataset.

Output:

Lookup function picks the “first matching value” from the second dataset DSPlayer.

To get all the matching we need to use the LookupSet function (along with Join)

Output:

To understand Multilookup, let us create one more entity Tournament that will have a text attribute which stores comma separated team name.

Let us create one more dataset DSTournament and bound it to a new table. Which have one column which lists the Tournament name and the other column that does the multilookup to DSPlayer to get the player name.

It brings the first matching value, by searching (doing lookup) on multiple value i.e. India and South Africa

Hope it helps..

“​SharePoint Attachment Extractor & Metadata Manager” tool for Microsoft Dynamics CRM

Two of the most common requirements of the users while using OOB CRM and SharePoint integration have been

  • To associate some sort of metadata with the  document being uploaded from CRM
  • Moving attachments from notes of a particular record to the corresponding folder in SharePoint.

Finally we have a tool than enhances the Out the box integration between CRM and SharePoint and provides these features (in a fully supported manner)

Get all the details here :

https://debajmecrm.com/2016/10/05/new-tool-dynamics-crm-sharepoint-metadata-manager-attachment-extractor/

The tool has been developed by one of my closest friends and now also a MVP for Microsoft Dynamics CRM – Debajit Dutta.

Task and Phone Activity Created through the Social Pane CRM 2013/15/16

Interesting

Ranjeet Patel

When I tried to run a post create plugin on any activity (i.e. phonecall,  task, email, etc) that time i was unable to get the regardingobjectid in the target entity.

then I looked into the Audit history of this entity and found out that at time of creation we don’t get the “regardingobjectid”, internally some workflow of something runs and it creates one update audit history, and i found out that update audit history really update the regarding object id.

then i registered  my post create plugin to post update plugin and this solved my problem.

View original post

Isolated Dynamics CRM Security Feature – “Reparent”

Understanding Reparent

Abstruser Musings

There’s a feature of Dynamics CRM (that’s been in the product since version 3, I believe) that actually lives outside of the “front-and-center” security model that you normally think of with Dynamics CRM security roles.

I’m talking about the cascading functionality defined in entity relationships. Specifically, there is a cascading property called “Reparent.” There’s an old (but still relevant) article here about how this reparent functionality works. As this article explains, if you have a 1:N relationship between accounts and opportunities, and in this relationship, you have set the “reparent” property to “cascade all,” this means that the owner of an account (Acme INC) will see any opportunities created with Acme INC as the related account, and any opportunities whose related account is updated to be Acme INC.

When does “Reparent” take effect?

To go a bit deeper though, it’s important to understand exactly when this reparent property comes into play. If…

View original post 604 more words

Retrieving related records in an N:N relationship using QueryExpression in CRM

Nice post on Retrieve from N:N relationship

Bernado Nguyen-Hoan's Blog - Coding Stories from an IT Mercenary

This post explains how the QueryExpression class can be used in conjunction with IOrganizationService.RetrieveMultiple() in CRM 2013 to retrieve related records for an entity in an N:N relationship. This is something that I could not find much documentation on, and it is not very straightforward – at least for someone starting out in CRM dev.

Scenario

I have two custom entities that have an N:N relationship between them: Course (logical name ng_course) and Subject (logical name ng_subject). The relationship is named ng_course_subject. The query that I need to write is to retrieve all Subjects assigned to a given Course.

Understanding QueryExpression and LinkEntity

The QueryExpression class is where you define your query. You can learn more about this class here: http://msdn.microsoft.com/en-us/library/microsoft.xrm.sdk.query.queryexpression(v=crm.6).aspx.

The key property of this class that enables us to retrieve the related records is the LinkEntities property, which is a collection of LinkEntity objects. Essentially LinkEntity

View original post 352 more words

The ‘distinct’ attribute is not declared error while trying to import solution in CRM 2016 (and earlier)

Hi,

Got this error while trying to import a managed solution in CRM 2016 Online.

During analysis we figured out that it was pointing to one of the charts created for System User Entity. It seemed like chart’s xml was modified after export and then imported. The xml definition of the chart contained distinct keyword.

Removing the distinct keyword from the Chart definition and importing it back and then importing the managed solution with this updated chart got imported without any error.

Hope it helps..

MB2-712 Certification: (Microsoft Dynamics CRM 2016 Customization and Configuration) – Revision Guide

Microsoft Dynamics 365 and Unified Service Desk

I have been completing a series of posts to help people prepare for the MB2-712 certification (Microsoft Dynamics CRM 2016 Customization and Configuration. Here is a collection of links to all of these posts. I hope these might serve as a useful revision aid for the MB2-712 exam.

The MB2-712 certification is not easy to study for. At least in my opinion! The reason being the scope of the exam. CRM is a large product and therefore customizing it is a big topic. But a fun topic and one you will really enjoy learning about.

Revision Notes (Introduction)

Introduction / Overview to MB2-712 Exam

Configure Microsoft Dynamics CRM

  • Configure Dynamics CRM settings
    • Configure auditing, document management and collaboration; configure business units; perform user management; configure email; manage teams
  • Manage Dynamics CRM security
    • Understand security roles; define permissions and privileges; configure access levels; configure security roles; assign security roles; work with…

View original post 341 more words