Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the...

23
Sage CRM Developers Course Workflow (1)

Transcript of Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the...

Page 1: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Sage CRM Developers Course

Workflow (1)

Page 2: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Looking ahead to the classes

DP01: Introduction to the Development Partner Program

DP02: Entities and the Data Model (Part 1 of 2)

DP03: Entities and the Data Model (Part 2 of 2)

DP04: Implementing Screen Based Rules (Part 1 of 2)

DP05: Implementing Screen Based Rules (Part 2 of 2)

DP06: Screen and User Independent Business Rules

DP07: Workflow (Part 1 of 2)

DP08: Workflow (Part 2 of 2)

DP09: Using the API Objects in ASP Pages (Part 1 of 2)

DP10 : Using the API Objects in ASP Pages (Part 2 of 2)

DP11: Using the Component Manager

DP12: Programming for the Advanced Email Manager

DP13: Using the Web Services API

DP14: Using the Web Services API (Part 2 of 2)

DP15: Coding the Web Self Service COM API (Part 1 of 2)

DP16: Coding the Web Self Service COM API (Part 2 of 2)

DP17: Using the .NET API (Part 1 of 2)

DP18: Using the .NET API (Part 2 of 2)

Page 3: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Workflow

Control of process and data tasksCRM offers graphical representationProgress through logical arbitrary steps/states using ‘rules’ that govern transition

RulesUser driven action– Uses JScript to check the data condition

– E.g.. whether rule is available

Time driven action– Uses SQL to check the data and time condition

– E.g.. whether the rule is executed

Workflow as a mechanism for implementing business rulesIntegrate tightly with other scripting E.g.. Field Level and Table Level

Page 4: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.
Page 5: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

A Simple Opportunity Workflow

New Oppo

Lead

Qualified Quoted

Negotiating

Sold

Quoted

Lost

SoldLost

Reassign

Convert from Lead Qualified

Page 6: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Graphical Workflow

Flow diagram of workflow process produced following analysis (previous slide) has to be understood and turned into CRM Graphical form.

Decision Tree like diagram

Looping and branching and reuse of rules and states supported

Page 7: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.
Page 8: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Custom Workflow Entities

EntityDefault Workflow

Workflow Progress Table

Mentioned in Config New Workflow

Opportunity P P P PCases P P P PSolutions P P P PLeads P P P PPerson O O P PCompany O O P PCommunications O O O PCampaigns P O P PWaves P O P PWaveitems P O P PCustom Entity O O O P

Page 9: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Workflow Configuration

Default Workflow provided for:Leads

Opportunity

Cases

Solutions

Campaigns

Waves

WaveItems

Enable Workflow in Admin>Configuration>Workflow

For other workflow capable entities then workflow always enabled

Page 10: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Workflow Tracking

Workflow LeadSolutionCaseOpportunity

All entities above work in same way.

Page 11: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

User Driven Workflow Rule Types

Primary Rules

Transition Rules

Conditional Rules

Global Rules

Page 12: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Primary Rules

Initial creation of record

ConditionControls whether button displays

NOTE: Where entity life cycle starts with Dedupe Search or Inbuilt System Action Custom Workflow needs to start with Transitional Rule e.g..NewCompany

NewIndividual

Page 13: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Limiting Access to Rules

Simplest way of limiting access is by using the "Restrict to Team" selection box.Code Needed for more complex restrictionsThe JavaScript Condition field on Primary, Transition, and Global rules limits whether or not the rule appears for a given record.The workflow button will be hidden where the script sets Valid to be false, and where Valid equals true then it will be displayed.To limit access to the rule to members of the Support and Operations team the JavaScript condition would be:

var intTeamID = CurrentUser.user_primarychannelid;if (intTeamID == 1 || intTeamID == 5){Valid = true;}else{Valid = false;}

Page 14: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Access to Primary Rules and Main Menu ‘New’ optionsUsing the JavaScript Condition to Control Primary Rule Availability

To hide the 'New' button on the case list called from the company and person tab bars (where the company is "on hold") the following JavaScript condition can be used:

var strStatus = CRM.GetContextInfo("company", "comp_status");if (strStatus == "On Hold"){Valid = false;}else{Valid = true;}

Note:The method GetContextInfo can be used here because the company entity is in context.

The Main Menu New Button & ContextThe example given will not hide the New Button that is called from the Main Menu, nor will it hide the New Button on the 'My CRM' nor the 'Team' menus.This is because the customer may not be known until the user chooses it in the company field of the case entry screen and confirms it using the Save button.In this example to stop the users creating a support case for a customer that is "On Hold" we need to use a validation rule.

This example validation rule can be added to a field such as case_referenceid that appears in the casedetailbox screen.

This validation rule will also act as a double check to the first example given.

intCompID = Values("case_primarycompanyid");var recComp = CRM.FindRecord("company", "comp_companyid ="+intCompID);if (recComp.comp_status=="On Hold"){Valid = false;ErrorStr = "You may not create a case for a company placed on hold.";}

Page 15: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Transition Rules

Transition RulesMovement from state to stateCondition– Controls whether button displays

A transition rule that is linked to the workflow 'entry state' can then be used to attach the record to a workflow. If a  record is created by system default behaviour (e.g. via a lead converted to opportunity) then the newly recreated record will have a null workflowid field. 

Page 16: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Global Rules

No movement from state to state

Available at all states once record added to workflow

ConditionControls whether button displays

Page 17: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Conditional Rules

Similar to Transition rule: Movement from state to state

ConditionButton always displayed

Controls branching of to alternate states triggering different actions based on data values

Page 18: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Action Availability

Set Colum

n Value

Reset

Colum

n Value

Display Fiel

d for Amendment

Show

Messag

e on

Screen

Show

Notification

on Screen

Send

Email

Send

SMS

Messag

e

Create Tas

k

Create

Opportunity

Create

Case

Create Lea

d

Create Solutio

n

Create

Merge

Document

Execut

e SQ

L Stateme

nt

Run Stor

ed Procedure

Create Tas

k for Target

List

Create

Docume

nt for

Target

List

Export Target

List to

File

Create Outbou

nd Call List

Primary P P P P O P P O O O O O O P P O O O O

Transitional P P P P O P P P P P P P P P P P P P P

Global P P P P O P P P P P P P P P P P P P P

Conditional P P P P O P P P P P P P P P P P P P P

Escalation P P NA NA P P P O O O O O O P P O O O O

Page 19: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Follow up Actions

The ability to create Tasks, Opportunities, Cases, Leads and Solutions is available to the following Workflow Rules types:Transitional

Global

Conditional

Create TaskThis will always create a communication that references the same workflowinstance as the creating entity. The Task will be attached to the same workflow

Create OpportunityThis will create a new opportunity that is unattached to workflow. This means that the oppo_workflowid will be null. The exception is when created from a opportunity workflow then same workflowinstance is referenced. The new Opportunity is part of the same workflow as the original opportunity

Create CaseThis will create a new case that is unattached to workflow. This means that the case_workflowid will be null. The exception is when created from a case workflow then same workflowinstance is referenced. In this instance the new case is part of the same workflow as the original case.

Create LeadThis will create a new Lead that is unattached to workflow. This means that the lead_workflowid will be null. The exception is when created from a Lead workflow then same workflowinstance is referenced. In this instance the new Lead is part of the same workflow as the original Lead.

Create SolutionThis will create a new Solution that is unattached to workflow. This means that the soln_workflowid will be null. The exception is when created from a Solution workflow then same workflowinstance is referenced. In this instance the new Solution is part of the same workflow as the original Solution.

Page 20: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Direct Execution of SQL statements

Complete SQL Statement (Full DML)Multiple Statements Allowed (;)Use of #field#E.g..update Comm_Link set CmLi_Deleted = 1 where CmLi_Comm_CommunicationId in (select Comm_CommunicationId from Communication where Comm_WaveItemId=#WaIt_WaveItemId#);update Communication set Comm_Deleted=1 where Comm_WaveItemId=#WaIt_WaveItemId#

NOTESeparate statements can not pass variablesCan’t declare variable in one statement then use it in another

Page 21: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Q&AQ&A

Page 22: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.

Looking ahead to the classes

DP01: Introduction to the Development Partner Program

DP02: Entities and the Data Model (Part 1 of 2)

DP03: Entities and the Data Model (Part 2 of 2)

DP04: Implementing Screen Based Rules (Part 1 of 2)

DP05: Implementing Screen Based Rules (Part 2 of 2)

DP06: Screen and User Independent Business Rules

DP07: Workflow (Part 1 of 2)

DP08: Workflow (Part 2 of 2)

DP09: Using the API Objects in ASP Pages (Part 1 of 2)

DP10 : Using the API Objects in ASP Pages (Part 2 of 2)

DP11: Using the Component Manager

DP12: Programming for the Advanced Email Manager

DP13: Using the Web Services API

DP14: Using the Web Services API (Part 2 of 2)

DP15: Coding the Web Self Service COM API (Part 1 of 2)

DP16: Coding the Web Self Service COM API (Part 2 of 2)

DP17: Using the .NET API (Part 1 of 2)

DP18: Using the .NET API (Part 2 of 2)

Page 23: Sage CRM Developers Course Workflow (1). Looking ahead to the classes DP01: Introduction to the Development Partner Program DP02: Entities and the Data.