Gilad Levy, Senior Consultant MCS
Microsoft DynamicsTechnical BriefRelationship & Interaction Management Platform (xRM)
Challenges Supporting Line of Business Activities of Companies Today
RELATIONSHIP MANAGEMENT
PROCESS AUTOMATION
INTERACTION TRACKING
LOB MANAGEMENT
SILOED INTEGRATED
Multiple Solutions Invest in ONE!
LOB Applications Platform
Building an LOB Application
Entity, Fields & Relationships
Forms, ViewsBusiness
RulesProcesses Workflow Custom Code
Finished Application
APIs
xRM Platform
Metadata Model
SalesWorkload
MarketingWorkload
CareWorkload Marketplace Custom Apps Partner Apps
AzureOffice 365 + SharePoint
Devices
Customers, Employees, Partners
ExtensibleArchitecture
Industry Template
Native xRM UI Custom UI
On PremiseOnline Azure
SaaS IaaS
Deployment Models
Self-Hosted
UNIFORM capabilities across deploymentsDeployment Migration to any model using Deployment Manager
Compatible CRM On Premise Version Performance Scale Azure IaaS Support
Multi-Geo supported with DR Financially backed SLAAdmin Center
Customer
Reference
Data
Line-Of-
Business
Application
Platform for
Broad
Engagement
(Social,
Mobile)
Enterprise
Business
Leadership
Microsoft
Oriented
Enterprise IT
SMB
Custom Native Client Apps (iOS, Android, Windows)
Web AppsTraditional Server-based logic – ASP .NET, Java, PHP, NodeJS
“Single-Page Apps” using JavaScript on client
Data Integration Tools (SSIS, Scribe, Azure DF, BOMI, etc.)
BI Tools (PowerQuery, etc.)
App Builders (Power Apps)
Integration Frameworks (Azure Logic Apps, Biztalk, etc)
Custom Integration Code (many platforms)
SOAP Services• Full functionality
• Optimized for .NET developer experience
• Very difficult to use from other platforms
Limited REST API• Limited functionality
• Basic CRUD & Query
• Poor Performance
Be open to all platforms
Match expectations of today’s developer audience
Approachable – Easy to accomplish simple tasks
Meet Enterprise RequirementsSecurity, Performance, Scalability
Build on standards to enable broad ecosystem support
•
•
•
•
•
•
•
•
•
•
•
•
using System.Net.Http;
using Newtonsoft.Json.Linq;
…
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "https://contoso.crm.dynamics.com/api/data/accounts");
request.Headers.Add("Authorization", "Bearer " + accessToken);
HttpResponseMessage response = httpClient.SendAsync(request).Result;
var responseBodyAsText = response.Content.ReadAsStringAsync().Result;
JObject responseObject = JObject.Parse(responseBodyAsText);
var propertyValue = responseObject["propertyName"];
var new DefaultContainer new "https://contoso.crm.dynamics.com/api/data/"
var = from a in .
where a.name == "Fabrikam"
select a;
void service_SendingRequest2(object sender, Microsoft.OData.Client.SendingRequest2EventArgs e)
{
//use ADAL to set the access token
e.RequestMessage.SetHeader(authContext.AcquireToken(...).CreateAuthorizationHeader())
}
//Client application must be registered in Azure AD
string clientId = ConfigurationManager.AppSettings["clientId"];
Uri redirectUri = new Uri(ConfigurationManager.AppSettings["redirectUri"]);
Uri apiUrl = new Uri("https://contoso.crm.dynamics.com/api/data");
//Ask the CRM instance who it trusts for authentication
AuthenticationParameters ap = AuthenticationParameters.CreateFromResourceUrlAsync(apiUrl).Result;
AuthenticationContext ac = new AuthenticationContext(ap.Authority);
AuthenticationResult ar = ac.AcquireToken(ap.Resource, clientId, redirectUri);
string accessToken = ar.AccessToken;
Primitive TypesString, Int32, Date, etc.
Complex Types
Entity TypesStructural Properties and Keys
Navigation Properties
Entity SetsContainers for collections of entities, support query
Functions and ActionsBound and Unbound
/accounts(985519d9-e08e-4374-a7d4-d15763a448e7)?$select=name,accountnumber&$expand=ownerid
GET /api/data/WhoAmI
{
"@odata.context": "https://tieara228org09.crm.crmlivetie.com/api/data/$metadata#mscrm.WhoAmIResponse", "BusinessUnitId": "677d2748-c42f-e511-80fa-00155d0a1303", "UserId": "c0ed9e36-5773-4355-be09-452510cb283b", "OrganizationId": "0e0b8108-0405-443c-926e-b471ab0c8492«
}
Client Server
ContactID of [email protected]?
User ID of [email protected]?
RegionID of NW Region?
AccountID for Account ABC123?
Update Account(AccountID, ContactID)
SetState(AccountID, Active)
Assign(AccountID, UserID)
Before
Client Server
After
Update Account(ABC123, [email protected], NW, [email protected], Active)
Entity account = new Entity("account", "accountnumber", accountNumber);
UpsertRequest Received
Does Record Exist?Yes,
Update
Call Update
No,Create
Alternate Key Values?
No
Yes
Copy key values to Target Entity
Attributes
Update Pre Plug-In s
Update Post Plug-In s
Call Create
Create Pre Plug-In s
Create Post Plug-In s
Package Results in UpsertResponse
Return UpsertResponse
Call Assign
Assign Pre-Plug-Ins
Assign Business Logic
Update Pre-Plug-Ins
Call Update
Update
Update Post-Plug-Ins
Assign Post-Plug-Ins
Return
Call Update
Update Pre-Plug-Ins
Update
Update Post-Plug-Ins
Return
Client Server
Create Order()
Before
Create Order()
Create Order()
Database
BEGIN TRANS
INSERT ...
COMMIT TRANS
BEGIN TRANS
INSERT ...
COMMIT TRANS
BEGIN TRANS
INSERT ...
COMMIT TRANS
Client Server
ExecuteMultiple([1,2,3])
ExecuteMultiple
Database
BEGIN TRANS
INSERT ...
COMMIT TRANS
BEGIN TRANS
INSERT ...
COMMIT TRANS
BEGIN TRANS
INSERT ...
COMMIT TRANS
Client Server
ExecuteTransaction([1,2,3])
ExecuteTransaction
Database
BEGIN TRANS
INSERT ...
INSERT ...
INSERT ...
COMMIT TRANS
Server
Before
Client 1 Client 2
Retrieve Contact A
Retrieve Contact A
Update Contact A
Update Contact A
DATALOSS!
Server
After
Client 1 Client 2
Retrieve Contact A
Return Row Version 1
Retrieve Contact A
Return Row Version 1
Update Contact A V1
Update Contact A V1
Error: Concurrency Conflict
Update Row Version to V2
• Quick Find uses the SQL LIKE
operator for text strings.
• “Starts with” search by default
• Many end user ’s provide wildcards to
search within the text.
• Doesn’t use an index and results
in poor performance
• Turned Off by default. Must be
enabled in System Settings.
• Text based FIND columns use SQL
full-text indexes.
• Fields that contain ALL words in the
search text are returned.
First available in Vega
UR1 for On Prem only.
Test Org Stats ResultsMSIT SMB Sales Org (450GB)
Overall time with 43 tests across 4 different entities + MEQF:
• 40 minutes without FTS
• ~27 seconds with FTS
Entity Row Count
Activity 5.4M
Account 4.1M
Contact 5.2M
Lead 2.4M
Opportunity 3.1M
Search Term Non-FTS FTS
*alexandria 74s 0.067s
*12 noon 73s 0.5s
*beeping 73s 0.078s
*Windows
Server 2012
120s 2.5s
Significant performance gains
over wildcard based searches.
Search across multiple entities directly
from the navigation
Perform code free calculations and
actions with Calculated fields
A calculated fields contain a value
calculated based on conditions and a
formula defined within that field
The conditions and formulas can refer to
the values of the other fields in the same
entity or values of the fields in the related
entities.
Record level aggregates computed from
related records
Rollup fields are used to capture key
business metrics at a record level from
related entities with 1:N relationships.
Rollup fields are calculated by a recurring
job, calculations are not in real time
Rollup Fields are calculated via scheduled
jobs (default every hour)
•
•
•
•
•
•
Out of Box Fields now supports Field
Level Security
User and manager relationshipsBased on Manager
Direct report reporting structure
Enforces a strict tree structureSame Business Unit is enforced
Cross business unitNo constraints on business unit hierarchy
Structure based on Position and Parent Position records
Users tagged to a positionPositions can be used for multiple users
Reporting structureUser doesn’t have to be a manager of a user to access data
Display customized help to the users
Unmanaged Solution
• Container of customizations that exist on top of the system and other managed solutions
• An “Open” solution Allows direct customizations to components of
CRM
Contains references to customization and components but does not “own” them.
Does not delete or remove components if the solution is deleted.
Managed Solution
• A “finished” unmanaged solution that has been exported as managed.
• Managed solutions are “locked” The Identity of the solution cannot be modified
Components cannot be removed or added to it.
Exists in its own layer and merges with other layers and the system layers to represent a view to the user.
Can be uninstalled ( Deleted ) from the system.