Dynamics 365 Customer Engagement: Overview, Architecture, and Getting Started

Dynamics 365 Customer Engagement: Overview, Architecture, and Getting Started

Introduction

Dynamics 365 Customer Engagement (CE) is Microsoft's comprehensive CRM platform for sales, service, marketing, and field operations. Built on Microsoft Dataverse (formerly Common Data Service), it provides a unified data model, robust security, and seamless integration with Power Platform. This guide covers CE architecture, core modules, configuration fundamentals, security models, and integration patterns.

Dynamics 365 Architecture

Platform Components

Architecture layers:

┌─────────────────────────────────────────────────┐
│         User Experience Layer                    │
│  Model-Driven Apps │ Canvas Apps │ Portals      │
├─────────────────────────────────────────────────┤
│         Application Layer                        │
│  Sales │ Service │ Marketing │ Field Service    │
├─────────────────────────────────────────────────┤
│         Business Logic Layer                     │
│  Plugins │ Workflows │ Business Rules │ Actions │
├─────────────────────────────────────────────────┤
│         Data Layer - Microsoft Dataverse         │
│  Tables │ Relationships │ Business Logic        │
├─────────────────────────────────────────────────┤
│         Integration Layer                        │
│  Power Automate │ APIs │ Connectors │ Events   │
└─────────────────────────────────────────────────┘

Microsoft Dataverse

Common Data Model (CDM):

Dataverse provides standardized tables (entities) for business data:

  • Core Tables: Account, Contact, Lead, Opportunity, Case
  • Activity Tables: Email, Phone Call, Appointment, Task
  • System Tables: User, Team, Business Unit, Security Role
  • Custom Tables: Organization-specific data structures

Table structure:

Account Table (Standard)
├── Columns (Fields)
│   ├── Account Name (Primary)
│   ├── Account Number
│   ├── Industry
│   ├── Annual Revenue
│   └── Owner (Lookup to User)
├── Relationships
│   ├── Account → Contact (1:N)
│   ├── Account → Opportunity (1:N)
│   └── Account → Case (1:N)
└── Business Logic
    ├── Business Rules
    ├── Workflows
    └── Plugins

Environment Setup

Creating a Dynamics 365 Environment

Power Platform Admin Center:

  1. Navigate to admin.powerplatform.microsoft.com
  2. Select EnvironmentsNew
  3. Configure environment:
Name: Production Sales CRM
Type: Production
Region: United States
Purpose: Sales and customer service operations
Create Database: Yes
Language: English
Currency: USD (cannot be changed later)
Enable Dynamics 365 Apps: Yes
Apps to Deploy:
  - Dynamics 365 Sales
  - Dynamics 365 Customer Service
Security Group: None (or select specific Azure AD group)

Installing Dynamics 365 Applications

Available applications:

  • Dynamics 365 Sales: Lead and opportunity management
  • Dynamics 365 Customer Service: Case management and knowledge base
  • Dynamics 365 Field Service: Work order and scheduling
  • Dynamics 365 Marketing: Campaign management and customer journeys
  • Dynamics 365 Project Operations: Project management and billing

Installation via Power Platform Admin Center:

# Using Power Platform CLI
pac admin list
pac admin create --name "Sales CRM" --type Production --region unitedstates
pac application install --environment "Sales CRM" --application-name "D365Sales"

Core Modules Overview

Dynamics 365 Sales

Key capabilities:

  • Lead Management: Capture, qualify, and convert leads
  • Opportunity Management: Track sales pipeline and revenue forecasting
  • Quote and Order Management: Generate quotes, orders, and invoices
  • Product Catalog: Configure products, price lists, and discounting
  • Sales Insights: AI-driven recommendations and predictions

Typical sales process:

Lead → Qualification → Opportunity → Quote → Order → Invoice
  ↓         ↓              ↓           ↓       ↓        ↓
Contact   Disqualify    Win/Loss    Revision Close  Fulfill

Dynamics 365 Customer Service

Key capabilities:

  • Case Management: Track customer issues from creation to resolution
  • Knowledge Base: Create and share articles for self-service
  • Entitlements: Manage service level agreements (SLAs)
  • Queues: Route cases to appropriate teams
  • Omnichannel: Engage via chat, SMS, social media, and voice

Case lifecycle:

Case Created → Assigned → In Progress → On Hold → Resolved → Closed
     ↓            ↓           ↓            ↓          ↓         ↓
  Auto-route   Owner     Research      Pending   Customer   Archive
               set       solution      info      confirms

Table Customization

Creating Custom Tables

Via Power Apps:

  1. Navigate to make.powerapps.com
  2. Select TablesNew tableNew table
  3. Configure table properties:
Display Name: Project
Plural Name: Projects
Description: Custom table for project tracking
Primary Column: Project Name
Enable Options:
  - Activities: Yes (emails, phone calls, tasks)
  - Notes: Yes (attachments and notes)
  - Connections: Yes (relate to other records)
  - Queues: No
  - Auditing: Yes (track changes)
  - Change Tracking: Yes (for integration)

Adding Columns

Column types:

// Single Line of Text
Project Name (Required, Max Length: 100)

// Whole Number
Estimated Hours (Min: 0, Max: 10000)

// Decimal Number
Budget (Precision: 2, Min: 0, Max: 1000000)

// Currency
Actual Cost (Precision: 2)

// Date and Time
Start Date (Date Only)
End Date (Date Only)

// Lookup (Relationship)
Project Manager (Lookup to User)
Customer (Lookup to Account)

// Choice (Option Set)
Project Status:
  - Planning (Value: 1)
  - In Progress (Value: 2)
  - On Hold (Value: 3)
  - Completed (Value: 4)
  - Cancelled (Value: 5)

// Multi-Select Choice
Technologies Used:
  - .NET
  - Azure
  - Power Platform
  - Dynamics 365

Creating Relationships

1:N (One-to-Many) relationship:

Account (1) → Projects (N)

Configuration:
Primary Table: Account
Related Table: Project
Lookup Column Name: Customer
Relationship Behavior:
  - Referential: Delete link (prevent orphaned records)
  - Cascade Delete: Remove related records
  - Cascade Assign: Update owner of related records

N:N (Many-to-Many) relationship:

Project (N) ↔ Contact (N)

Configuration:
Table 1: Project
Table 2: Contact
Relationship Table Name: project_contact
Purpose: Track team members assigned to projects

Business Rules

Client-Side Validation

Business rule example:

Name: Validate Project Dates
Scope: All Forms
Conditions:
  - If: Start Date > End Date
    Then:
      - Show Error: "Start date cannot be after end date"
      - Set Business Required: End Date
      
  - If: Project Status = "In Progress"
    Then:
      - Set Field Visibility: Actual Cost = Visible
      - Set Business Required: Project Manager
      - Lock Field: Start Date

Creating business rules:

  1. Open table → Business rulesNew
  2. Add conditions and actions:
    • Conditions: Field equals, contains, greater than, etc.
    • Actions: Show/hide fields, set required, set default value, show error, lock/unlock

Security Model

Security Roles

Role-based security:

Dynamics 365 uses a combination of:

  • Security Roles: Define privileges on tables
  • Business Units: Hierarchical organization structure
  • Teams: Group users for access control

Privilege levels:

Privilege Depth:
├── None: No access
├── User: Own records only
├── Business Unit: Records owned by users in same BU
├── Parent: Child Business Units: Records in BU and child BUs
└── Organization: All records

Privilege Types:
- Create: Add new records
- Read: View records
- Write: Edit records
- Delete: Remove records
- Append: Associate records (relationships)
- Append To: Be associated by other records
- Assign: Change record owner
- Share: Grant access to other users

Creating Custom Security Roles

Example: Project Manager role:

Role Name: Project Manager
Business Unit: Root
Privileges:
  Project Table:
    Create: Business Unit
    Read: Organization (view all projects)
    Write: Business Unit (edit own BU projects)
    Delete: User (delete own projects)
    Assign: Business Unit
    Share: Business Unit
  
  Account Table:
    Create: None
    Read: Organization
    Write: None
    Delete: None
  
  Contact Table:
    Create: Business Unit
    Read: Organization
    Write: Business Unit
    Delete: User
  
  Activity Tables (Email, Phone, Task):
    Create: Business Unit
    Read: Business Unit
    Write: Business Unit
    Delete: User

Field-Level Security

Securing sensitive data:

Table: Contact
Secured Column: Social Security Number
Field Security Profile: HR Managers
Permissions:
  - Create: Yes
  - Read: Yes
  - Update: Yes

Integration Patterns

Web API

OData queries:

// C# example using HttpClient
var client = new HttpClient();
client.BaseAddress = new Uri("https://org.api.crm.dynamics.com/api/data/v9.2/");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");

// Retrieve accounts
var response = await client.GetAsync(
    "accounts?$select=name,accountnumber&$filter=revenue gt 1000000&$top=10");
var accounts = await response.Content.ReadFromJsonAsync<AccountCollection>();

// Create contact
var contact = new
{
    firstname = "John",
    lastname = "Doe",
    emailaddress1 = "john.doe@example.com",
    parentcustomerid_account@odata.bind = "/accounts(12345678-1234-1234-1234-123456789012)"
};

var createResponse = await client.PostAsJsonAsync("contacts", contact);
var contactId = createResponse.Headers.Location.Segments.Last();

PowerShell example:

# Using Microsoft.Xrm.Data.PowerShell
Install-Module Microsoft.Xrm.Data.PowerShell

# Connect
Connect-CrmOnline -ServerUrl "https://org.crm.dynamics.com"

# Retrieve accounts
$accounts = Get-CrmRecords -EntityLogicalName account `
    -FilterAttribute "revenue" -FilterOperator "gt" -FilterValue 1000000 `
    -Fields name,accountnumber -TopCount 10

# Create contact
$contact = @{
    firstname = "John"
    lastname = "Doe"
    emailaddress1 = "john.doe@example.com"
}
New-CrmRecord -EntityLogicalName contact -Fields $contact

Power Automate Integration

Automated workflow example:

Trigger: When a record is created (Dataverse)
  - Table: Opportunity
  - Scope: Organization

Condition: Amount > 100000
  If Yes:
    - Send email notification to Sales Manager
    - Create approval request
    - Update Opportunity: Set "Requires Approval" = Yes
  
  If No:
    - Update Opportunity: Set "Auto-Approved" = Yes
    - Log activity

Azure Logic Apps Integration

Enterprise integration:

{
  "definition": {
    "triggers": {
      "When_Opportunity_Won": {
        "type": "ApiConnection",
        "inputs": {
          "host": {
            "connection": {
              "name": "@parameters('$connections')['commondataservice']['connectionId']"
            }
          },
          "method": "get",
          "path": "/v2/datasets/@{encodeURIComponent('org.crm.dynamics.com')}/tables/@{encodeURIComponent('opportunities')}/onnewitems"
        },
        "conditions": [
          {
            "expression": "@equals(triggerBody()?['statecode'], 1)"
          }
        ]
      }
    },
    "actions": {
      "Create_SAP_Order": {
        "type": "ApiConnection",
        "inputs": {
          "host": {
            "connection": {
              "name": "@parameters('$connections')['sap']['connectionId']"
            }
          },
          "method": "post",
          "body": {
            "CustomerID": "@triggerBody()?['customerid']",
            "Amount": "@triggerBody()?['totalamount']"
          }
        }
      }
    }
  }
}

Best Practices

  1. Data Model Design: Leverage standard tables before creating custom ones
  2. Security First: Apply principle of least privilege
  3. Business Logic Location: Use business rules for simple logic, plugins for complex
  4. Naming Conventions: Use prefixes for custom tables (e.g., contoso_project)
  5. Solution Management: Always work within solutions for ALM
  6. Testing: Create separate environments for Dev, Test, and Production
  7. Documentation: Document customizations and business processes

Troubleshooting

Plugin Registration Tool errors:

Error: "User does not have required privileges"
Solution: Ensure user has "System Administrator" or "System Customizer" role

Web API authentication failures:

// ✅ Correct Azure AD authentication
var credential = new ClientSecretCredential(
    tenantId: "your-tenant-id",
    clientId: "your-client-id",
    clientSecret: "your-client-secret");

var token = await credential.GetTokenAsync(
    new TokenRequestContext(new[] { "https://org.crm.dynamics.com/.default" }));

Key Takeaways

  • Dynamics 365 CE provides comprehensive CRM capabilities built on Dataverse
  • Microsoft Dataverse offers a standardized data model and robust security
  • Security roles combine with business units for flexible access control
  • Web API and Power Automate enable powerful integration scenarios
  • Solution-driven development ensures proper application lifecycle management

Next Steps

  • Explore Solution Layers and Application Lifecycle Management (ALM)
  • Implement Plugins for server-side business logic
  • Build Custom Workflows with Power Automate
  • Create Model-Driven Apps for tailored user experiences

Additional Resources


Engage customers, empower teams.