Menu Close

Category: Blog

EXTENDING DYNAMICS CRM IMPORTANT CONCEPTS

Review

Navigation and Command Bar-Customization
Form event scripting
Web resources
Working with services
Querying CRM data
Using the Rest OData endpoint
Plug-ins
Custom workflow activities

CONFIGURE , CUSTOMIZE AND EXTEND

Configure: System Settings, Security Settings, Email Configuration, Data Management.


Customize: Schema Changes, Form & View Chnages, Visualizations, Solutions , Processes

Extend: Client Scripting, Navigation, Plug-ins, Workflow Activities, Integration


BUILT – IN FUNCTIONALITY

Before you start designing you won custom items to extend the application consider the built-in options available.

.Processes Tracking & Automation
  -Workflows, Dialogs, Business Process Flows, Custom Actions

.Client Side Customizations:
   -Business Rules, Rollup fileds, Calculated Fields, etc.

.Additional Funtionality:
 -Product Catalog, Case Management, Service Management.


EXTENDING CRM

CLIENT
-Navigation & Commanding
-Client Scripting
-Custom User Interfaces

SERVER
-Plug-ins
-Custom Workflow Activities
-Custom Actions

INTEGRATION
-3rd Party Applications
-Remote Plug-in Execution
-Power BI 
-Sharepoint


NAVIGATION AND COMMANDING

.SITE MAP: Used to control application navigation
 – Navigation Elements can be added, edited and Removed as needed.

-COMMAND BAR: Display actions and commands that are available
 – Can Add, Remove, and Edit.

URL ADDRESSABLE FORMS: Access CRM forms and lists directly through their URL.



API DRIVEN SCRIPTING

-Allows for enhanced functionality & flexibility on forms

– calculated fields, formatting, data validations etc.

Scripts can be associated to events at a form and fileds levels
 – Onload, Onsave, Onchange, TabStateChange etc..

-Script Libraries are used for easier deployment and availability

-Business rules provide simple business at the field level.
 -Don’t require uploading of custom scripts
 – Can be created by non – developer
 -Traditional client javascript can focus on more complex tasks
 -Can run on the server also.


CUSTOM USER INTERFACES WITH WEB RESOURCES

– Stored in CRM as solution components
-Exported to any CRM deployment
-AVailable in Outlook with offline access

Types:
-Javascript
-HTML Web Page
-Images(PNG, JPG, GIF, ICO)
-Style Sheets (CSS and XML)
Sliverlight


BUILDING SERVER SIDE EXTENSIONS

-Organization service API provides data and service request execution
-Rich event model allows for triggering custom code using plg-ins
-Custom worklfow activities allow custom code to execute from declarative workflows.
-Custom actions allow defining custom messages that are callable from code but the implementation is defined declaratively.


————————————————————————————————————————–

WORKING WITH DATA AND SERVICES

-REST endpoint for working with data
-SOAP endpoint allows full message execution

Task                                                                                               Web Service
create, Retrieve, Update and Delete records                 SOAP OR REST ENDPOINT
Associate and Disassociate records                                SOAP OR REST ENDPOINT
Assign Records                                                                 SOAP ENDPOINT
Retrieve Metadata                                                           SOAP ENDPOINT
Execute Messages and anything else                              SOAP ENDPOINT

————————————————————————————————————————–

THE EVENT MODEL

Create Request
      |
Pre-Operation Events
     |
Platform Operation
     |
Post-Operation Events
     |
Create Response

=============

API access for CRM metadata and deployment services

-Working with metadata
  – Provides support for querying and dynamic discovery of values
  – Creating /Changing
  -Example – add entity and add attributes etc
  -Example- I need the labels for an option set converted to the current                     users language settings

-Working with deployment services
 -Create /Manage organizations, servers, licenses, etc.

-Discovery service
  – Determine organization a user belongs to and endpoint URL for each organization


————
Plug-ins
-.Net assemblies
-Can be triggered off multiple messages events
-Can run a different stages
-On-Premises and Online
-Offline and server execution options


Custom workflows activities
-.Net Assemblies
-Building blocks for composable custom code
-Can be used by workflows or dialogs
-Support all deployments types by allowing execution in sandbox

=============

CUSTOM ACTIONS

Custom actions are multi -step declarative custom logic that can be invoked via API calls

-Example -Schedule, Escalate, Route Lead

-Actions are a new type of processes that allows specification of input and ouput parameters

-Actions can be called from code

Can also be called from workflows or dialogs

-Execution is always synchronous

======================

Integration

-Unified Service Desk
-Azure Active Directory
-Azure Service Bus
-Portals and other custom user experiences

Unified Service Desk:
Windows Desktop App that loads an agent desktop experience
Agent desktop configured vai CRM entities that define how the components are presented and intreacted with

Developers can further extend beyond configuration using the UII framework directly.

————————————————————————————————————————
Azure Active Directory: 

 Standalone Cloud Directory
 Provide authentication for CRM Online

Provide support for integration with on-premises

Provides API support


Azure Service Bus:
 Works with Dynamics CRM’S Async service to offload work from CRM
  Secure integration with 3rd parties

MULTI TENANT DEPLOYMENT

 -Multi – Tenant uses:
-Hosting company providing dynamics CRM for multiple customers
-Separate organization undera single holding company
-Separate organizations for development, testing, production, etc in a single deployment.

example:
A. Single Tenant, Single Instance(one database)

B.Multi Tenant, Shared Deployment(One database, one server)

C.Multi Instance, Multi Deployment(two databases, two servers

Share this:

LEARN MORE FROM MICROSOFT DYNAMICS CRM SDK

Learn More from the SDK

Other Examples from the SDK

–Add Activity
–Auto Route Lead
–Date Checker
–Distance Calculator
–Post URL.

 Workflow Activities


Custom Worklfow Activities make good building blocks to allow non-developers to do custom code in workflows

CRM Developer Toolkit provides a streamlined approach to building Custom Workflow Activities

Share this:

MICROSOFT DYNAMICS CRM WORKFLOW ACTIVITY.

CUSTOM WORKFLOW ACTIVITIES

-Allows building custom steps that are available for use in the web workflow designer.

-Built on Windows Worklfow Foundation V4.

-Work for on-premise and CRM online deployments

– Can be used in workflows or dialogs.

————————————————————————————————————————–

Overview of CRM Workflows

– Rule: Define the logic that is executed when a specific triggering event occurs on a record.

— Events: Assign, Attributes Chnage(Update), Change Status, Create, Delete and On Demand

–Conditions: Check values to provide rules for what actions to perform.

–Actions: Create Record, Update Record, Assign Record, Send Email, Start Child Workflow, Change Status, Stop Workflow

————————————————————————————————————————–

OVERVIEW OF CRM DIALOGS

-Input Arguments: Data that is passed from  a parent dialog.

-Variable: Store intermediate values as users move through the dialog.

-Pages: Provides the body of the dialog by adding prompts and responses

-Prompts & Responses: Poses a question to a user and captures the response.

-Actions & Conditions: Checks values and performs specifics tasks.

——————————————————————————————————–
WORKFLOW EXECUTION WITH CUSTOM ACTIVITIES

   Workflow
 step1 -Check Condition
 step2 – Update Record
 step3 -Your Custom Activity

————————————————————————————————————————–

CUSTOM ACTIVITY SCENARIOS


-Complex calculation

-Performing actions on child records

-Pull a customer’s credit score from a 3rd party to be used for loan approval

-Any Integration with other systems called on demand.

– Any scenario where you want to surface custom code in the CRM workflow editor.


CUSTOM WORKFLOW ACTIVITY CLASS DIAGRAM

Without Developer Toolkit

–CodeActivity Class

–Your Custom Class

–code example:

public sealed partial class CustomActivity : CodeActivity
{
   protected override void Execute(CodeActivityContext executionContext)
{

}
}

With Developer Toolkit

–CodeActivity Class

–WorkflowActivityBase Class

–Your Custom Class

–code example:

public sealed partial class CustomActivity : CodeActivity
{
public override void ExecuteCRMWorkflowActivity(CodeActivityContext executeContext, LocalWorkflowContext crmWorkflowContext)
{

}
}

————————————————————————————————————————–

WORKING WITH PARAMETERS

-Used to configure a workflow activity
– Exposed via the worklfow editor

CRM supports two types
   — input and ouput

–Values are populated at time of execution of cutom activity

The DefaultAttribute class allows you to specify a default value for an input parameters

Declaring Parameters

[RequiredArguments]
[Input(“InputEntity”)]                    ————-1
[ReferenceTarget(“account”)]

public InArgument<EntityReference> inputEntity {get; set;}
[Output (“TaskCreated”)]
[ReferenceTarget(“task”)]            —————–2

public OutArgument<EntityReference> taskCreated  {get; set;} —–3

protected override void Execute(CodeActivityContext executeContext )
{

}

————————————————————————————————————————–

Getting and Setting Parameters Values


Setting and getting values must is done using the Set/Get methods and referencing the execution context

Guid accountId = this.inputEntity.Get(executionContext).Id;

this.taskCreated.Set(executionContext, new EntityReference(“task”, taskId));



————————————————————————————————————————-

Working with services


The Workflow ExecutionContext.GetExtension method provides access to the CRM services like

–Organization Service

–Tracing Service

IWorkflowContext context = executionContext.GetExtension<IWorkflowContext>();

IOrganizationServiceFactory serviceFactory = executionContext.GetExtension<IOrganizationServiceFactory>();

IOrganizationService service = serviceFactor createOrganizationService(context.UserId);




Working with Services using Developer Toolkit


public class CustomWorkflowActivity : WorkflowActivityBase
{
    public override void ExecuteCRMWorkflowActivity(CodeActivityContect executionContext, LocalWorklfowContext crmWorkflowContext)
{
     crmWorkflowContext.Trace(“Plug-in is Starting”);

var  whoamiResult  = crmWorkflowContext.OrganizationService.Execute(new WhoAmIRequest());
}
}





Share this:

DYNAMICS CRM ONLINE UPDATE 1 TRACING SUPPORT

DYNAMICS CRM ONLINE UPDATE 1 TRACING SUPPORT

-TRACE PLUG-IN LOG CAN WRITE RUN-TIME INFORMATION ON PLUG-INS
USING THE ITRACINGSERVICE.

Trace records can be viewed through web application 
-Setting -Plug-in Trace Log Tile

To Enable the trace logging feature

Option                                                        Description
-Off          -Writing to the trace log is disabled. No PluginTraceLog records will be created(Custom                                             Code can still the Trace Method even though no log is written)

-Exceptions        -Trace information is written to the log if an exception is passed back to the platform                               from custom code.

-All                  -Trace information is written to the log upon code completion or exception is passed back to the platform from custom code

Share this:

PLUG-INS TRACING AND DEBUGGING – ON PREMISES

Tracing  and Debugging plug-ins –On-Premises

-Register and deploy the plug-in assembly.(Disk)

-Configure the debugger
Plugin Registration Configuration                      Service Process
-Running the application in onlinemode              -w3wp.exe

-Running the application in offlinemode              -Microsoft.Crm.Application.Hoster.exe
                                              
-Asynchronous registered plug-ins                        -CrmAsyncService.exe

-Sandbox(isolation mode)                                       -Microsoft.Crm.Sandbox.WorkerProcess.exe                               
Share this: