DCSIMG
Yaniv Arditi

Microsoft Dynamics CRM – Team Share vs. User Share

Microsoft Dynamics CRM – Team Share vs. User Share

Sharing records in Microsoft Dynamics CRM is often used to solve matrix like authorization problems.

For example, let’s say our organization has two main divisions: Sales and Products. While Opportunities are managed in the Sales division by Sales Managers, Presale Engineers from the Products Division are required to view these opportunities as well. Opportunities hold sensitive information and Presale Engineers should have access to specific Opportunities which are related to the product they manage.

Microsoft Dynamics CRM hierarchical authorization model allows users from one business unit to access business records owned by users from a sibling business unit only by granting them global access level which allows users to access all the records in the organization. This problem can be solved by the Sharing mechanism which allows granting ad hoc record level access level.
In the previous example, a Sales Manager can share an Opportunity with Presale engineer to grant him access to only the record which requires his attention.

Another solution is to set up a team for each product, while each team will include the required Presale Engineers. Sharing an Opportunity with a the a team rather than with a single user is preferred because as the team members change, their share access is automatically adjusted: access is granted to new team members and revoked from members leaving the team. Sales Manager need only remember the product team name and is indifference to the actual team members.

For enterprise level applications, sharing business records with teams rather than users is critical. Share authorization data is managed in central database table named PrincipalObjectAccess (POA). The POA table is accessed by any query related to data access level, and with Microsoft Dynamics CRM, most queries do. As the POA table grows large, application performance may decrease. Is it recommended to keep the POA table as small as possible.
Sharing records with Team, rather than with users can help achieving this goal: each share per object is represented by a record, so sharing an Opportunity with 3 users will add 3 records to the POA table. But sharing an Opportunity with a Team (related to N members) will only add one record to the POA table. In large scales, this fact can have a major impact on Microsoft Dynamics CRM performance.

Microsoft Dynamics CRM 2011 Workflow Based Approval Process implementation – Part 3

Microsoft Dynamics CRM 2011 Workflow Based Approval Process implementation – Part 3

This post is the last in a series of three posts which describe a common implementation problem of a business approval process, possible solutions and actual solution implementation.
Although in my example I used an approval process of a Quote discount %, this model can be used to implement any linear business approval process. 

While the first post presented the problem and requirements, the second post describes a specific possible solution. In this post I will explain the solution implementation and it’s characteristics.

In the first post I described the problem’s main characteristics:

  1. Each of the involved employees should be able to find out the stage in which the Approval process is at
  2. Involved employees should be notified on tasks which require their attention, even if they do not login to the application
  3. The process should behave intelligently if some stage has exceeded a certain amount of time. For example, If the CFO has not responded in 3 days, a proper notification should ne sent to the Sales Person
  4. Approval process is asynchronous in nature and should ‘wait’ for the next user input without consuming expensive system resources
  5. The process should be flexible, so it can be easily adjusted to an ever changing business requirements. For example, adding another approving role or an additional Quote related condition
  6. The process should be applicable for Online and On-Premise deployments

In the following step-by-step user scenario walkthrough, I’ll explain how each problem is solved.

Implementation Notes

  1. Team vs. User: In some organizations, an approval task can be assigned to specific user, while in other a team of users handle the approval task. Assigning an Approval record to a team, rather than to  a specific user, is useful when some employee is unable to document the decision (e.g home sick). In that case, any Team member can take and document the decision.
    In Microsoft Dynamics CRM 2011, Team can be assigned with Security Roles and can own records. These features allows you to assign the Approval record to to a Team. When an Approval record is assigned to a Team, the plugin component (E4D.CRM.Plugins.Approval) will handle sending email notification to each Team member.
    Since Team may have only one member, I find it more flexible and prefer assigning an Approval record to a Team rather than to a specific user. If you still want to assign an approval task to a user, change the Workflow rule described here.
  2. The implemented solution is based on the Workflow engine. I chose to let users activate the Quote approval process manually, but you may want to activate the process automatically when the Discount % value changes, using the proper Workflow trigger.
  3. The Workflow process structure has been divided into four rules to allow re-use and encapsulation. Still, adding or updating business parameters, such as Discount % levels and approving users/teams, are managed in the main Workflow rule (Quote Approval Process: Main ).

User Scenario Walkthrough

  1. Activating Quote approval process

Sales Person adds a Discount % value to an existing Quote, saves the Quote and clicks the Run Workflow button to activate the approval process

image

image


2. Approval record initiation

Approval record is created automatically by the Workflow and assigned to the Sales Person team. The Approval decision status is ‘undecided’. The Approval’s note reflects the business process stage.

image

image

3. Sales Manager Notification

Each member of the Sales Manger team receives an email notification regarding the pending approval task. The email notification includes a link to the Approval record.

image

image

4. Sales Manager decision

Sales Manager edits the Approval record and change decision to Approved and saves the Approval record

image

5. Approval record Status

The Approval record is assigned to the CFO team and decision value is again defaults to ‘Undecided’. The Approval record notes reflect the business process progress.
The CFO team members receive an email notification regarding the pending approval.

image

6. CFO approval

CFO team member decides to approve the discount % and changes decision to ‘Approved’. The approval record is assigned back to the Quote owner and its state changed to Inactive, as this is the end of the business process. The Quote owner receives a email notification regarding the approval granted.

image

Solution Details

The solution is packaged as a Microsoft Dynamics CRM 2011 Solution which can be downloaded here. This is a managed solution and before you activate it in your environment you will have to edit it in order to adapt some elements like users or teams. Following are the solution components:

  1. Quote entity customization – One custom attribute which is not visible in the entity form and is used to indicate if a Quote record is currently in an approval process
  2. Approval entity customization – Custom entity which represents the approval process data and process
  3. Quote Approval Process: Main – Main workflow rule which defines the approval process flow. It uses child workflows to implement repetitive logic. Before activating this rule, make sure you replace the Team/User with principals in your organization
  4. Quote Approval Process: Approval Stage – Child workflow rule which encapsulates approval process stage
  5. Quote Approval Process: Approval Granted – Child workflow rule which encapsulates approval granting logic
  6. Quote Approval Process: Finalize - Child workflow rule which finalizes any approval process logic
  7. Quote Approval Required notification – An email template used to notify a user that an his attention is required
  8. Quote discount % approved notification - An email template used to notify a user about a Quote discount % approval event
  9. Quote discount % disapproved notification - An email template used to notify a user about a Quote discount % disapproval event
  10. E4D.CRM.Plugins.Approval – A plugin component used to send an email notification the team members in the event of Approval record assignment

Conclusion

Microsoft Dynamics CRM 2011 is a very powerful mechanism which enables the configuration of a complex business process such as an approval process.
As Custom Activities are not supported yet in Online deployments, a plugin component can support custom business logic such as sending email notification to team members.
Please feel free to comment on the implementation methods and help improve this solution.

Microsoft Dynamics CRM 2011 Workflow Based Approval Process implementation – Part 2

Microsoft Dynamics CRM 2011 Workflow Based Approval Process implementation – Part 2

In the previous post I have described a common business problem – the approval process. In this post, I will suggest a possible solution, while the next post will demonstrate an actual implementation.

If you have an idea for additional solution or suggestion on how to improve the following solution, feel free to comment.

 

Data Structure

As the approval process is required in various business processes (Sales, Services, etc.), the approval data must be generic in order to fit into any business scenario with minimum or no changes in the existing data entities. Another requirement dictates that each business entity may go through the Approval process more than once. E.g: Once a Sales manager disqualified a Quote, the current approval process ends. When the Sales persons edits the Quote, he initiate a second approval process for the same Quote record.  

The ideal solution for these constraints is to create a designated data entity which can be related to any other business entity such as Quote, Case or any custom entity. This solution will allow relating more than one Approval record to each business record and also requires no change in the logical structure of the business entity. Additionally, It will allow a better management of privileges for the  approval data, without changing privileges for existing business entities.

The Approval entity will have the  following data attributes:

#

Name

Description

1. Subject Describes the approval subject
2. Decision Describes approval/disapproval decision
3. Decision Date Date and time of approval/disapproval decision
4. Disapproval Reason Reason for disapproval
5. Remark Additional information
6. Status Approval status (Approved/disapproved/pending)
7. Owner Describes the person currently handling the approval process stage

 

Process Automation

The approval process dictates predefined stages, different approving roles, approval timeout and notification capabilities. All these characteristics requires process automation which is based on events.
Being asynchronous in nature, the approval process automation must be asynchronous as well.

Microsoft Dynamics CRM 2011 supplies us with two asynchronous event driven mechanism: Workflow Rule and Plugin component. While both mechanisms are basically supported by all types of deployments (On-premise/Hosted/Online), there are some limitations:

1. Workflow Custom Activity component is not supported by Online deployments.
2. Although a Plugin component can be registered to operate asynchronously, it can not ‘wait’ for some events such as the passing of 3 days from the approval assignment date.

As the suggested solution must support both On-premise and Online deployments, it will be based on standard Workflow Rules and Code components which will be wrapped by Custom Activity or by Plugin component.

Following is the process algorithm diagram:

 

 

Approval Process Algorithm

 

In the last post of this series I’ll describe an actual implementation of the suggested solution.

Microsoft Dynamics CRM 2011 Workflow Based Approval Process implementation – Part 1

Microsoft Dynamics CRM 2011 Workflow Based Approval Process implementation – Part 1

In this and in the following two posts I will address the common problem of implementing an Approval process using Microsoft Dynamics CRM.
While this post will describe the business scenario and problem, the next posts will suggest a possible solution and an actual implementation. You are welcomed to add your take on the problem or the solution. 

Business Scenario

In many business applications an Approval process is required. Approval process often involves different users with different business roles approving a decision or a business record in a parallel or linear manner. One common example is the approval of a Quote which is created by a Sales Person. The Quote usually includes a discount rate, which in some conditions requires the approval of the Sales Manager. Before the Quote is sent to the customer, it sometimes require the approval of the CFO.

This linear Approval process involves a business record (the Quote), different business roles (Sales Person, Sales Manager and CFO) and an hierarchy which dictates the order of approvals. In case the Sales Manager or the CFO rejects the requested discount rate, the approval process will return to the Sales Person for review with a proper notification.

 

image

The Problem

Here are the problem’s main characteristics:

  1. Each of the involved employees should be able to find out the stage in which the Approval process is at.
  2. Involved employees should be notified on tasks which require their attention, even if they do not login to the application.
  3. The process should behave intelligently if some stage has exceeded a certain amount of time. For example, If the CFO has not responded in 3 days, a proper notification should ne sent to the Sales Person.
  4. Approval process is asynchronous in nature and should ‘wait’ for the next user input without consuming expensive system resources.
  5. The process should be flexible, so it can be easily adjusted to an ever changing business requirements. For example, adding another approving role or an additional Quote related condition.
  6. The process should be applicable for Online and On-Premise deployments.


What’s Next?

In the next post I’ll suggest a possible solution. Tune in!

Microsoft Dynamics CRM Online Out Of The Box

Microsoft Dynamics CRM Online Out Of The Box

I recently gave a webcast for Microsoft Israel on the subject of Microsoft Dynamics CRM Online customization features.
I described and demonstrated customization tools that do not require development skills, such as form customization, Report Wizard, Workflow etc.

The webcast was given in Hebrew and the recording can be viewed  here.

Posted by Yaniv Arditi | with no comments

Microsoft Dynamics CRM 4.0 View Records Filtering

Microsoft Dynamics CRM 4.0 View Records Filtering

In Microsoft Dynamics CRM 4.0 views, you can sort records by clicking the column header. Did you know you can also filter records?
I didn’t know, until last week, and this is quite embarrassing for me…

It turns out that after sorting a view column by clicking the column header (and by this, selecting the column), clicking a letter in the letters index at the bottom of the grid will filter the view records which values in the selected column starts with the selected letter.

For example, in the following Leads view, I have sorted by Topic. Now, clicking ‘W’ in the letters index will return only one record with the Topic value of ‘Where is Spongebob?’.

image

Posted by Yaniv Arditi | with no comments

Updating CRM records via Excel Export in Microsoft Dynamics CRM 2011

Updating CRM records via Excel Export in Microsoft Dynamics CRM 2011

In Microsoft Dynamics CRM 2011 data can be exported to Excel file. This feature can be used to update CRM data externally and then import back while updating the matching CRM records.

When exporting data to Excel, select the ‘Static worksheet option’ and check the ‘Make this data available for re-importing’ checkbox.

image

 

Off course, the re-importing functionality relies on the CRM records GUIDs to uniquely identify each CRM records that requires an update. But when you open the exported Excel file, the GUIDs column is not visible. You can expose this column in Excel 2010 by following the next steps:

  1. Open the exported file Excel
  2. Click the Review tab
  3. Click the Unprotect Sheet button in the Changes group
  4. Mark the whole sheet by clicking ctrl+A
  5. Click the Home tab
  6. Click the Format button in the Cells group
  7. Open the Hide & Unhide men and select the Unhide Columns menu item

As you can see below, you get 2 more hidden columns (with an explicit warning to avoid changing).
The Lead column contains the exported Leads GUIDs. The Modified On column describes the CRM record Modified On value.
I suspect the Checksum column is used by the Data Import module to verify that the hidden columns have not been tempered with. Indeed, if you try re-importing after changing any of the hidden columns values, the Import operation will fail with the error description ‘You cannot import data to this record because the record was updated in Microsoft Dynamics CRM after it was exported.’

 

image

E4D CRM 2011 Ribbon Customization Utility

E4D CRM 2011 Ribbon Customization Utility

I have recently done a lot of Ribbon customization tasks in Microsoft Dynamics CRM 2011.

As there are few references on this issue, these tasks involves a lot of trial and error iterations, each require zipping the solution files, uploading to the server and publishing. After 2 or 3 iterations, this becomes exhausting and mind numbing.


For that reason I have developed the Ribbon Customization Utility, which can be downloaded at Codeplex, along with source code and a short demo video.

This utility will do the heavy lifting for you: it allows you to connect to a Microsoft Dynamics CRM 2011 deployment, either Online or On Premise. Once connected, you can select the Ribbon Solution files directory and click the Import Solution Button.
This will zip the Solution files, upload the zip fie to the server and publish the solution (if the Publish Solution checkbox is checked). You can also check the Delete Current ZIP file(s) and that will delete previous ZIP files every time you click the Import Solution Button, but you may want to keep these files for backup.

While working on Ribbon customization tasks, keep this utility open and just click the Import Solution Button each time you want to check the results of your customizations.

Note: this product is in Beta version, I do not recommend using it on your production environment yet.

 

image

Upcoming webcast: Microsoft Dynamics CRM 2011 – Customizing the Ribbon

Upcoming webcast: Microsoft Dynamics CRM 2011 – Customizing the Ribbon

On 7.6.2011 I’ll be lecturing in a webcast titled ‘Microsoft Dynamics CRM 2011 – Customizing the Ribbon ’. This webcast is hosted by xRMVirtual user group.

During this one hour session, I’ll review the new Ribbon features, capabilities and customization options.

You are all invited to register  in the following link

http://www.xrmvirtual.com/events/CRM2011_ribbon

You can download the webcast materials and presentation PDF here. The Solutions are managed, so you can easily install and remove them. Still, don’t install these solution on Production environments.

The Ribbon Customization Utility I used in my demo is available for download here.

Upcoming Workshop - Microsoft Dynamics CRM 2011–What’s New?

Upcoming Workshop - Microsoft Dynamics CRM 2011–What’s New?

On 31.5.2011 I’ll be giving a one day frontal course on the new features of Microsoft Dynamics CRM 2011.

I’ll be reviewing new features in the UI, Customization and administration areas with relevant demonstrations.

More details can be found here.

Accessing Dynamics CRM 2011 Organization Service: it’s all about timing

Accessing Dynamics CRM 2011 Organization Service: it’s all about timing

While trying to access Dynamics CRM 2011 Organization Service from a client machine I received the following error:

“An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail”. The inner exception stated: “An error occurred when verifying security for the message”

This exception was received only by some clients while other were able to consume the service successfully.

This error is quite generic and gives no clue about the actual reason for the failure. Only after activating the CRM trace I found out the culprit, which turns out to be lack of synchronization between the server clock and the client clock as the server clock was set to support day light saving and the client wasn’t.

So, upon receiving this exception, check the following:

1. The client clock is synched with the server clock.

2. Both client and server are coordinated on the day time saving settings

CRM 2011 How to: set IFrame control content dynamically

CRM 2011 How to: Set IFrame control content dynamically

CRM 2011 features the Sub Grid  which allows displaying related records grid in the form of the parent entity using only customization tools. For example, displaying all open Opportunities in the form of the parent customer.

This is a great feature which was missing in version 4.0 and required some scripting. Yet, some entities are not supported by this feature. For example, the Audit entity (which is not available in Advanced Find as well. Why???).

To solve this problem, you can use the following function in the parent entity form OnLoad event, while setting the required parameters. Note that you can send the entity from id as an optional parameter in case the Sub Grid is relevant to a specific entity form.

In this example, I used the following parameters to call the function in the Account OnLoad event, assuming the Account form has an Iframe control named IFRAME_audit.

"IFRAME_audit", 1, "areaAudit", "Audit History",""

 

//iframeObjId - iframe control schema name

//objectType  - container entity code

//areaName    - related entity area name

//formId      - entity form id (optional)

function SetIframeContent(iframeObjId, objectType, areaName, iframeTitle, formId)

{   

    //Get iframe control

    var iframeObject = Xrm.Page.getControl(iframeObjId);

    if (iframeObject != null)

    {

        //assemble URL

        var strURL = "areas.aspx?formid=" + formId + "&navItemName=" + iframeTitle + "&oId=" + Xrm.Page.data.entity.getId() + "&oType=" + objectType + "&pagemode=iframe&security=852023&tabSet=" + areaName;

        //Set iframe URL

        iframeObject.setSrc(strURL);

    }

}

By default, when using this solution, the form ribbon lose its context sensitivity. In order to work around this, map the following function to the iframe OnReadyStateComplete event (in the iframe events tab). It’s an ugly solution, but it works:

function RefreshRibbon()
{
    Xrm.Page.ui.navigation.items.get()[0].setFocus();
    Xrm.Page.ui.tabs.get()[0].setFocus();
}

Audit sub grid in Account form

Finally, this function is not documented in the SDK and therefore not supported.

Microsoft Dynamics CRM 2011 Release Candidate (RC) Announcement

Microsoft Dynamics CRM 2011 Release Candidate (RC) Announcement

In this latest announcement, Microsoft confirms the on-premises Release to Manufacturing (RTM) in Q1, 2011. Following are the download links for the RC version

 

Component

Name

URL

Language Availability

Server RC

Microsoft Dynamics CRM 2011 Server Release Candidate

http://www.microsoft.com/downloads/details.aspx?FamilyID=c3f82c6f-c123-4e80-b9b2-ee422a16b91d

Available in English only 

Outlook Client

Microsoft Dynamics CRM 2011 for Microsoft Office Outlook

http://www.microsoft.com/downloads/details.aspx?FamilyID=22dc423a-7194-491e-a169-6ace16bfdd36

Available in 25 languages

Language Pack

Microsoft Dynamics CRM 2011 Language Pack

http://www.microsoft.com/downloads/details.aspx?FamilyID=db44c564-2338-407e-980a-c9c83ad37729

Available in 41 languages

Email Router

Microsoft Dynamics CRM 2011 E-mail Router

http://www.microsoft.com/downloads/details.aspx?FamilyID=a995f6ad-0099-42fd-9b22-cf7b3d40a2bf

Available in 25 languages

Report Extension

Microsoft Dynamics CRM 2011 Report Authoring Extension

http://www.microsoft.com/downloads/details.aspx?FamilyID=64a09b75-8376-4b9d-aea3-8a83a1837c4d

Available in 25 languages

SharePoint

Microsoft Dynamics CRM 2011 List Component for Microsoft SharePoint Server 2010

http://www.microsoft.com/downloads/details.aspx?FamilyID=23c0f351-8694-4d92-9ddf-34a949aec6a7

Available in 41 languages

TechEd 2010 - 60 Minutes Magic with Dynamics xRM

TechEd 2010 - 60 Minutes Magic with Dynamics xRM

During Microsoft TechEd 2010 convention I gave a lecture named ‘60 Minutes Magic with Dynamics xRM’.

The lecture purpose was to demonstrate how easy it is to build an xRM solution using Microsoft Dynamics CRM. This is not a new concept, it was first presented in the PDC convention as far as I know.

But as the PDC presentation was based on 4 people working on Microsoft Dynamics CRM 4.0, while my lecture was based on 2 people working on Microsoft Dynamics CRM 2011 Beta and therefore, somewhat more challenging.

Vered Friedman (VP Dynamics in E4D) co-lectured with me, and while I took care of code development tasks, Vered handled customization tasks. We presented on two screens, one showing Vererd’s laptop and the other showing mine. This allowed each viewer to concentrate on what ever interested him.

The business scenario used for the lecture was a recruitment management application for the Krusty Krab restaurant, and involved related business processes.


The lecture presentation can be downloaded here, and the related code can be downloaded here.


 

 

 

Posted by Yaniv Arditi | with no comments

Lookup Fields Auto Complete Search

Lookup Fields Auto Complete Search

In Microsoft Dynamics CRM 4.0 Lookup fields have an Auto Complete feature. This means that instead of opening the Lookup window or using the Form Assistant, you can start writing a value within the Lookup field, and when you take the focus away from the field, the Auto Complete will try to resolve the matching records according to the value typed.

If no record can be resolved, the Lookup will show a red error sign.

Lookup field Auto Complete no options

If more than one record was resolved, a yellow warning sign will appear. Clicking the yellow sign will display all the resolved values and allow you to select the correct record.

Lookup field Auto Complete Multiple options

If one record was resolved, the Lookup field value will fill up automatically with this record primary attribute value (usually, the record name).


This is commonly known time saving feature, that helps users look up records without opening new window or even the Form Assistant. By the way, you can use the asterisk search operator here too.

But did you know the Auto Complete feature can search on additional fields other than the record name?

For example, suppose you want to lookup a Contact by his email address. If the email attribute of the Contact entity is defined as a search field in the Contact entity Lookup view, you can just type the Contact’s email address (assuming the Contacts email field contains a value) and the Auto Complete will resolve the Contact’s name according to the email value and will fill the field automatically.

It is not a good practice to define too many search fields, as it will impact the SQL performance eventually. Find out your users common search criteria and stick to that.  

In order to define a search field, follow these steps:

1. Open the Contact entity lookup view in Forms & Views

Define search field 

2. Select the email field, save the view and publish the entity

Select email as a search field

More Posts Next page »