Tip #1302: Should I recreate the account entity?

When deploying Dynamics 365, there are frequently multiple types of companies and organizations that you will be tracking in the system. Some represent customer/client organizations, some may be support and advisory organizations like accountants and legal firms, and some may be miscellaneous types of organizations, such as trade associations.

How should you manage multiple categories of company relationships?

The most common approach is to use the account entity for all organization types, and use a field like relationship type or a custom option set to flag companies by their type or category. Views can be filtered based on the type of company, and business rules can conditionally show or hide field and form components based on type.

Another approach is to create custom entities for each type of company. One reason commonly sited is “I might need to use accounts for another reason in the future, so I don’t want to customize the account entity.”

Before recreating the account entity as a custom company entity, consider strongly what you give up by doing this:

  • Multiple addresses: Account has a unique address capability that supports multiple addresses—the first two addresses are displayed on the company form, but these address records live in the related customer address entity. While you can create a custom address entity tied to a custom company entity, recreating the unique logic where the addresses are stored in the related entity as well as displayed on the form and entity views would require development. If you need multiple addresses, use the account entity.
  • Contact hierarchy: Accounts are the parent of contacts. Activities related to contacts roll up to the parent account record. This hierarchy cannot be replaced by a custom company record—you can create additional relationships with custom company entities, but the standard account/contact relationship cannot be replaced. If the company has contacts with their primary company relationships to this type of company, or if you want to roll up activities from contacts to companies, use the account entity.
  • The standard map control does not support custom company entities.
  • Hierarchical relationships between parent/child accounts and the standard hierarchy visualization and roll up of child account activities to parent account only work with standard account entity.
  • Dynamics 365 includes a special type of polymorphic lookup field called a “customer” field. This field allows a record to be linked to a company/account or a contact. Dynamics 365 does not allow for custom entities to be selected from polymorphic lookup fields.
  • Marketing won’t work: Marketing lists can only work with contacts, accounts, and leads, no custom entities. Dynamics 365 for Marketing can send to accounts and contacts, but not custom company entities.

So in almost every situation, the account entity should be used for company records of all type.

What are the exceptions?

  • Minor types of companies that are not relational and have minimal attributes—think of a type of organization with no contacts, address, and just there for lookup purposes.
  • Unqualified/unverified companies imported from business cards or web forms that we don’t want to pollute the account entity. For these you could use the lead entity (or maybe not https://crmtipoftheday.com/501/should-you-use-the-lead-entity/).

Don’t believe me? Here is what other MVP’s have to say:

Using a custom entity for companies is at the top of the list for 10 things you never ever want to do in your customer engagement system. I run into this all the time where clients think they need to set up a different entity to track vendors separately from their customers. put them all in the account entity which is the bucket for businesses and filter them based upon a option set if you don’t go down this path you lose all the built-in functionality of parent-child relationship of businesses to contacts and you end up destroying the overall Integrity of your business model.

Jerry Weinstock

We always use the account as a base for organizations. Then if we need to extend it say it’s a school with specific requirements around it, we then create an entity ‘school’ but looked up to ‘account’ which hold all the basic info like you pointed out. Or sometimes it’s a matter of adding a flag to the account. But I can’t remember an instance in the last 12+ years of creating a custom account entity.

Gayan Perera

The logic of creating custom company entities doesn’t make a lot of sense. The only time I’ve ever thought of not recommending account or contact is if they plan on deploying multiple third party solutions to the same instance.  But even then, just be thoughtful in your design and understand the third party components.

Jim Novak

I had a customer once that had repurposed the contact entity and created a custom contact entity. They ended up not being able to use any marketing-oriented solution or feature.

Ulrik Carlsson

If they don’t use the account entity, they might as well just get CDS without any first-party apps and rebuild everything from scratch. Cases, Opportunities, Contacts, all roll up. Are they going to avoid those as well? (For what it’s worth, ClickDimensions handles using Accounts for different relationship types like vendor/partner/customer just fine).

Matt Wittemann

Cover photo by Blaz Erzetic from Pexels

Tip #1301: When Dynamics 365 for Marketing segments disagree with Advanced Find

Today’s tip is from marketing superstar Allison Fierce. Got any tips? Send them to jar@crmtipoftheday.com.

Are you trying to reference a custom lookup field on your contact record when building Segments in D365 for Marketing? Are you not getting any members? It might be because of you haven’t enabled the entity for segments.

Enabling an entity for Segments requires you to set up two components:

  1. Change tracking must be enabled on the entity itself
  2. You must check the box for that entity under Customer Insights sync
     

You can enable change tracking, if it isn’t already on, by going to your preferred solution and making that customization to the entity record:

For our Customer Insights sync, you’ll make the configuration in the D365 for Marketing Settings area. Under the Marketing Settings subgroup, you’ll find the Customer Insights sync configuration for your environment. Only entities that are enabled for this will work with your Segments tool.

To make your custom lookup function with a segment, check the box here and then be sure to click the “Publish” button at the top of the entities list.

It may take up to 30 minutes to see the system reflect this change.

Please keep in mind, these settings cannot be turned off once they are enabled. They do affect your system’s performance, so the best practice is to only enable the entities you need to use with segments.
 

Once you enable the entity for use in segments, you can choose to build your segment referencing that entity.  Below, you can see a segment built to look for Active Contacts whose related user record (our lookup field) equals a specific user.

Tip #1300: CDS vs Dynamics 365 instances

Dynamics 365 Apps are built on top of Common Data Service

Citizenship in IT, 2019 edition

If that’s the case, we should be able to install/uninstall Dynamics 365 Customer Engagement Apps at will, right? Yes. In theory. In the future. Decoupling Dynamics 365 CE from the underlying platform is a long and painful process.

Our special UK correspondent Mohamed Mostafa reports. (Would you like to be our special correspondent yourself? Send the tip(s) to jar@crmtipoftheday.com.)

With many new customers adopting PowerApps, they are building instances (environments) of type CDS Only and building Apps on these new instances. Although, CDS only instances do look almost the same as a new Dynamics 365 instance, they are indeed different. As it stands, you cannot currently install a Dynamics 365 1st Party app (for example Field Services) on a CDS only instance. Additionally, there is no way currently to upgrade a CDS instance directly to be a Dynamics 365 instance.

Take this example scenario: A “Lead Capture” PowerApp created on a CDS only environment gets widely adopted by an organisation and it becomes essential to add more built-in features and functionality from the Dynamics 365 Sales App and the Dynamics 365 Sales AI (Sales Insights) App. At the moment, adding these Dynamics 365 Apps to a CDS only instance is not possible. A direct upgrade of this CDS only environment to be a Dynamics 365 instance is also not possible. The only solution in this case is to migrate the CDS instance with all its data, configurations and Apps to a new Dynamics 365 instance. This now becomes a migration project not just a simple upgrade.

Hence, it is essential for any individual or team looking to build a new PowerApp to consider the future of this App. If the use of Dynamics 365 1st Party Apps is expected, then they should build this PowerApp on a Dynamics 365 instance not on a CDS only instance.

Cover photo by unsplash-logoRaquel Martínez

Tip #1299: Split email personalities

In the world of the email router, incoming and outgoing profiles were separate, so one user or queue could have separate email servers. Let’s say you wanted incoming email to come from exchange, but you wanted to send outgoing email via SMTP, you could do it.

With the deprecation of the email router, the only option is server-side sync. With server-side sync, the incoming and outgoing email settings are on the mailbox record, and there is only one mailbox per user or queue.

So what to do if you want email to come in via Exchange and go out via SMTP or or some other connection?

MVP Gustaf Westerlund makes a strong case for using forward mailbox for this scenario. With forward mailboxes you can split the channels.

One additional approach is set up two different queues and associate the email address with both queues. the “in” queue is only set up for server-side sync for incoming email and associated with an email server profile for your exchange server. The “out” queue is set only set up for server-side sync for outgoing and associated with an email server profile for your SMTP server.

When an email comes in, it may still go to the “out” queue, since it matches by email address. To prevent this, simply create a real time workflow that creates a queue item when an item is added for the “out” queue, adding the item to the “in” queue. This will make any items added to the “out” queue get moved to the “in queue.

Then, when you send your responses to items in the “in” queue, select the “out” queue as the “from.”

If it confuses users to see two queues, only give them access to the in queue and use a real time workflow to change the “from” on emails sent from the “in” queue to the “out” queue.

Cover photo by unsplash-logoLinh Pham

Tip #1298: Quickest way to filter views and forms in an app

Today’s tip from Linda Connolly – thanks! You can send your tip to jar@crmtipoftheday.com too!

I spotted this one when doing some work earlier in the week. 

If you’re building a business unit specific solution for a customer and want to quickly and easily only show them the views/forms designed for them, add the Site Map to your solution and then create a new model driven app from within the solution. It will automatically filter down the views and forms to what has been included in the solution file and add the sitemap.

Any entities not included in the solution will have all forms/views added automatically. From there you just need to edit your sitemap, if required, and check to make sure you’ve included your quick create/advanced find views on the included entities but you have a customised model driven app without the need to pick 5 views from a list of 20.

Cover photo by Sharon McCutcheon from Pexels

Tip #1297: Base your base role on the CDS User role

The very first tip of the day I wrote was Tip 2: Use a Base Security Role. The point of this tip is don’t jam every permission needed by each group into each role–use a common role that includes the minimal permissions needed to log into the application for all users, then create smaller roles for each group with only their unique permissions.

In the past I recommended starting with the salesperson role, pretty much the standard role with the lowest permissions, as the basis for the base role–copy the role and then add the permissions needed by all users.

With the move to the common data service and PowerApps, Microsoft has added a new standard role: Common Data Service User. This role includes permission needed to log into a model-driven app and access the common data service, including user level permissions for accounts, contacts, activities, but no Dynamics 365 restricted entity access and no sales or opportunity entities.

This makes the CDS User Role an ideal role upon which to base your base role. It includes everything users need to access the common data service without including any permissions for sales or customer service entities.

Cover image by Rene Asmussen from Pexels

Tip #1296: Quoting for developers

If you think this tip is great, I’ll take it as a compliment. If you think it’s lame, Joel is the one to blame because he was the one who convinced me to publish it.

I like smart quotes (in Word and in Outlook). They make your text look “smart” without too much effort. On the other hand, they are pain in the neck when you need to insert a piece of code that contains single or double quotes. Smart quotes ain’t so when copied and pasted into a code editor.

This is what I do when I use Word/Outlook and want to make my code reusable: I type the quote and then immediately press Ctrl-Z. That “undoes” just the last operation which happened to be the conversion of a quote to a smart one. Problem solved.

Cover photo by unsplash-logoFlorian Klauer

Tip #1295: Quickly search for multiple records in advanced find

If you want to quickly find multiple records in advanced find, you can type in semicolon-separated text values into your filter.

This can be a huge time saver, as you can copy/paste the string in, and assuming they are legitimate records, each value will resolve.

This is also helpful for testing a set of records after a data update.

Note — there is a limit to the number of values you can enter. Based on testing, it is somewhere around 65.

Thanks to Edgar Chan for this tip. Got any tips? Send them to jar@crmtipoftheday.com.

Tip #1294: Export solution before running solution checker

tl;dr

If you are getting “Couldn’t Complete” message from the solution checker, verify you can export the solution before running the solution checker. That way you’ll be able to see what’s wrong instead of an unhelpful “couldn’t complete” message.

Today’s tip is from Andrew Wolfe. Got a tip? Send it to jar@crmtipoftheday.com.

Tip

I created a solution recently in a test system and ran the solution checker but I constantly got a “Couldn’t Complete” message.  I logged this with Microsoft who, as ever, needed to see me run the checker and see the message before they’d look for what was wrong.  The answer from Microsoft in the logs was:

Microsoft.Crm.CrmException: Failed to export Business Process "Compliments Process" because solution does not include corresponding Business Process entity "aaw_complimentsprocess". If this is a newly created Business Process in Draft state, activate it once to generate the Business Process entity and include it in the solution.

So I tried exporting the solution as unmanaged and got the same error message as Microsoft had found.  My BPF was published but I used “Add Required Components” to add the associated entity.  I then tested that I could export the solution, this time it worked and then the solution checker could also complete and give me a set of results. So check you can export a solution before you run solution checker as that way you’ll be able to see what’s wrong rather than a just couldn’t complete message.

Tip #1293: Make case customer a contact

If you use automatic record creation and update rules in Dynamics 365/CDS to create cases automatically from emails, you should know the default behavior is to set the Customer field on the case to the parent company of the email sender and set the contact field to the email sender.

This is great for many companies, but in some cases, you want the customer to be set to the sender of the email, such as when service is provided to individuals, not their company/employer.

If you want to change the default behavior, when you create the record creation and update details, on the case form you will notice that the customer field is mapped to {null(Channel Properties)}

Remove the field mapping and using the form assistant, set the value of the customer field to the sender of the email.

Thanks Brandi Bozek for the tip. Got a tip? Send it to jar@crmtipoftheday.com.

Cover photo by unsplash-logoRoman Arkhipov