Menu Close

Blog

Slide 1

Microsoft Business Applications Blogposts, YouTube Videos and Podcasts

Helping Businesses with Technology

Slide 2

Microsoft Business Applications Blogposts, YouTube Videos and Podcasts

Helping Businesses with Technology

Slide 3

Microsoft Business Applications Blogposts, YouTube Videos and Podcasts

Helping Businesses with Technology

previous arrow
next arrow

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:

MICROSOFT DYNAMICS CRM TRANSACTION SUPPORT

TRANSACTION SUPPORT 


-CRM stages suport plug-in execution inside the database transcation

-Stages 20 Pre-Operation & 40 Post – Operation

-Uncaught exceptions force a rollback

-IExecution Context is in Transcation

-Transaction spans CRM DB operations only 

– No distributed transcation support.

Share this:

SANDBOX PLUG-INS RESTRICTIONS

MICROSOFT DYNAMICS CRM SANDBOX PLUG-INS RESTRICTIONS

– Only HTTP and HTTPS protocols are allowed

– Access to localhost (loopback) is not permitted

– IP addresses cannot be used. (Plug-ins must use a named web addresss that requires DNS resolution)

-Anonymous authentication is supported and recommended. No provision for prompting for credentails or saving credentails.

Share this: