Implementing Approval Verification Processes

I have been invited again to post on the Microsoft Dynamics CRM Team Blog. The article can be reached here;
http://blogs.msdn.com/crm/archive/2009/01/12/implementing-approval-verification-processes.aspx

Today we welcome Microsoft Dynamics CRM MVP Umar Khan who is a Microsoft CRM Consultant. You can read more from Umar on his blog at http://umarkhan.wordpress.com.

In business processes, there are sometimes scenarios in which certain steps require approval, authorization or verification from specific users to move forward. Microsoft Dynamics CRM 4 can be customized to implement such Role based or User dependent processes. One such example could be the requirement of authorization if opportunity is of more than 10K USD. I will be suggesting few options for implementing such a feature.

Note: This article assumes that reader is familiar with CRM Customizations, the CRM SDK and web services.

First step will be creating a new bit (or picklist) attribute in the entity and then adding it on the form. Bit field can either have true or false value but existing records will have null value in the new bit field. If approval field has false value then it means current record is not approved yet, else if it has true value then it means it is approved. Another option can be to use the existing status field for approval and unapproval by adding new values in picklist of status reason field. Simplest solution will be to depend upon the users themselves to control the updating of the approval field. All the users will have access to update the approval field but normal CRM users may not try to change the value of approval field and only Manager User change the value to approve or unapproved as per their decision.

But better solution will be to enforce the process and making sure that unauthorized user could not change the value of approval field. So by using web service call in “on load” event of the form, we can determine the current login user and then can make the approval field enabled or disabled depending upon the current login user’s rights.( How to Control Update Access for a Field )

There are some other options also available for implementing this process with more interactive interface;

a. Using JavaScript’s Confirm box:

1. After creating a field on entity to store the Approval or Unapproval status, add it on form and make it read only. By default its value will be false.

2. Add an “Approval” button on the toolbar of the entity window. A click on it will trigger the approval functionality.

3. When user clicks this button, using web service, check if the current login user is the authorized person to give the approval.

4. If it is not then alert the message that “You are not authorize to approve.”

5. If it is the authorized person then show “Confirm” box for user input.

  1. if ( confirm(“Please approve the credit facility for the Account.”) )
  2. { alert (“Approved”);}
  3. else
  4. { alert (“Unapproved”);}

JavaScript: Confirm box

6. If OK is pressed then make the approve status field to True otherwise its value will be False. Using JScript, you can enable or disable fields on the form depending upon the approval status.

Note: JavaScript’s “Prompt” box can be used if you want the user to also pass some important value before moving further.

JavaScript: Prompt box

JavaScript solution is suitable when requirement is for only approval and unapproval. If end user needs to perform more actions than most probably the second option will be better.

b. Model window ASPX web form:

ASPX web form can be used to give CRM user more options then only Ok and Cancel. Basically an ASPX page can be developed to be shown in model window for user input. A modal dialog box retains the input focus while open. The user cannot switch windows until the dialog box is closed. Opportunity Close window is an example of this form. This ASPX page development will involve good understanding of .net and CRM SDK and it will be hosted on Web Server. This model window may open on click of the “Approval” toolbar button. Steps will be almost same as JScript Prompt box. In case CRM Users are using Outlook offline client, then this ASPX page is required to be hosted in all the client machines also to make this feature functional in case of offline mode.

c. CRM Workflow:

CRM workflows are one of the mostly used solutions for the approval feature. Develop “on demand” workflow rule which is only accessible to authorized users. A complex authorization process can be easily implemented in CRM workflows. Workflows will mostly give solution without involving coding and they will be easy to manage and deploy. Workflows can also be triggered on the click of a toolbar button with the help of some JScript. The disadvantage in this solution is that it will take few seconds before workflow is executed and if form is still open then it will not automatically refresh to reflect the changes on the form. User needs to manually refresh the page to see the changes like change of value in approval field. Sometimes, changes are not required to be seen immediately; in those cases this solution is ideal.

CRM Workflow window

If you have some specific scenarios with different solutions, we’d love to hear from you.

Cheers,

Umar Khan

Microsoft Most Valuable Professional ( MVP ) for Microsoft CRM

MVP

I’m very happy to announce that I am given the Microsoft MVP award for a second time:

Dear uMar Khan,
Congratulations! We are pleased to present you with the 2009 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others.
The Microsoft MVP Award provides us the unique opportunity to celebrate and honor your significant contributions and say “Thank you for your technical leadership.”

I received the first MVP award in January 2008. Being awarded the second time in a row is a great honor.

Thank you Microsoft.

Rolling out CRM: Who should take ownership?

I have been invited to post on the Microsoft Dynamics CRM Team Blog. The article can be reached here;
http://blogs.msdn.com/crm/archive/2008/11/24/who-should-take-the-ownership.aspx

Today we welcome Microsoft Dynamics CRM MVP Umar Khan who is a Business System Consultant for SISCOM in Saudi Arabia. You can read more from Umar at http://umarkhan.wordpress.com. Umar also spends time in the Dynamics Forums answering your questions.

It is always a tricky responsibility, who should take the ownership of not only the successful implementation of Microsoft Dynamics CRM but also making sure that its internal users are using CRM in a way which can ultimately help in achieving the expected goals of CRM strategy. Just installing and configuring a fine CRM software is not enough. Providing CRM training is also not the last step. It is most important that employees of the company are ready to use CRM even if they are reluctant. People are often reluctant to accept change. But by providing concrete examples of how this product can be used to improve an employee’s performance, the best of your staff will quickly gravitate towards using the new solution set.

So who is the right person to take the responsibility for making sure that CRM is being used as planned? Many times, the first answer you will hear will be that it is Microsoft Dynamics CRM Consultant’s job. Wrong! At least that is what I think; this should be someone within the organization, someone with the following capabilities;

  • Good skills of influencing even without power or someone with authority.
  • Someone at managerial position.
  • Someone who himself is convinced that CRM is The Solution.
  • He needs not know all the features and usage of CRM but must know from where he can get the answers.

This person needs do take practical steps like making sure that sales persons are updating the manager on the opportunities using CRM and not their previous unleveraged methods of direct emails, phone calls or verbal communications. The number of activities and notes being created in CRM is a good way to determine successful usage of CRM by the staff.

Remember to manage the expectations of the consumers of CRM. Be ready to distinguish between the two types of CRM application users. They have different requirements and objectives from CRM:

  • Ones who are most of the time going to enter data in CRM.
  • And the ones, who are going to make decision, monitor and manage by reviewing the data stream in CRM using the various visualization tools.

Don’t only use CRM as a central data repository; use CRM to help define and streamline the processes of the business related to the customers. In this manner, both your company and your customers will benefit.

A consultant should set the expectations of client and try to sell the solution instead of only the software. For example:

If you want an integrated solution, using tools and systems that are ubiquitous in the workplace, then Microsoft Dynamics CRM is the obvious solution. And don’t under-estimate the customization power of CRM 4. If you want further capabilities based on the unique needs of your company, there are numerous ways to tap into the extensibility model built in to Microsoft Dynamics CRM. Its rich built-in customization tools, flexible Software development Kit (SDK), powerful workflows, integrated reporting, seamless integration with other Office applications can turn this CRM application into a specialized vertical solution for your company.

Umar Khan

Can I add new tables in CRM Database?

I hear this questions lot of time during presentations and in newsgroups. Many people answer it, “No, Microsoft doesn’t support creation of new tables in CRM Database.” But right way to answer this question is; yes, new tables can be added to Microsoft SQL database but the way to add them is to add entities in CRM Application. Direct tables creation in CRM database is possible but not recommended and supported by Microsoft.

In general terms, an Entity is a table in CRM database or is like a class. Attribute is like column or field of a SQL table or property of a class. When a new custom entity is created in CRM, behind the scene, CRM platform is creating SQL table. A developer don’t needs to interact with table, he only interact with CRM Web services or SQL views.

There are mostly two tables created for each entity. Like for Account entity, there are two tables called AccountBase and AccountExtensionBase. New custom attributes are always added to AccountExtensionBase table. Same is the case for new custom entities. If you add new entity called “Test” with prefix “new” then the tables created in database will be New_testBase and New_testExtensionBase.

Back

Hey everyone, very busy year. I was always there on newsgroups, forums and my email address (imumar@gmail.com) but not very active on my blog. I am back now 

Microsoft Most Valuable Professional ( MVP ) for Microsoft CRM

Microsoft has honored me with the Most Valuable Professional ( MVP ) Title for Microsoft Dynamics CRM.

Thank you Microsoft and all those who helped me to get to this position.

This is one of the coolest professional accomplishments of my career.

My MVP Profile: https://mvp.support.microsoft.com/profile/uMar.Khan

MVP

 

CRM Modules can be renamed?

Yes, you can rename the Microsoft CRM modules shown on the left navigation bar of main CRM application window. You guessed right, you can do this with the help of sitemap XML file.

For instance, change the “Service” module name to “Helpdesk”. Following are the steps:

  • Settings -> Customization -> Export Customization
  • Select Sitemap from the list of exportable entities.
  • Click on “More Actions” and than “Export Selected customization”
  • Click OK on Jscript alert.
  • Save the customization file.
  • Open the customization file for edit.
  • Find following line

<Area Id=”CS” ResourceId=”Area_Service” Icon=”/_imgs/services_24x24.gif” DescriptionResourceId=”Customer_Service_Description”>

  • Add Title=”Helpdesk”. After the change, the line will look like following

<Area Id=”CS” Title=”Helpdesk” ResourceId=”Area_Service” Icon=”/_imgs/services_24x24.gif” DescriptionResourceId=”Customer_Service_Description”>

  • Save the customization file.
  • Go to Settings -> Customization -> Import Customization
  • Browse to the saved sitemap file and upload it.
  • After the upload gets completed, click on “Import All Customization”.
  • Refresh you browser.

crm-modules-can-be-renamed.jpg

Recursive Workflow, Recursive Reminders

Manual Workflows  of Microsoft CRM 3 can be called recursively to achieve some new possibilities. Recursive Reminders are one of them.
 
If requirement is something like this that send reminder, if opportunity is open even after 7 days of its creation date. Ok. No problem. It can be easily developed. But if it is also added in the requirment that keep reminding after every 7 days if opportunity is open, than stop, we have to think.

There is a solution, a very simple one, create a recursive manual workflow.

You will need to create two workflows. One manual WF and another one on Create event for the sole purpose of calling the manual workflow.
Let’s first create manual workflow.

recursive-workflow-recursive-reminders-1.jpg

recursive-workflow-recursive-reminders-2.jpg

Note: If current WF is not saved than its name will not appear in the list of the sub processes. You will once need to save the manual WF and than open it again to add the action of calling sub process.

Now you need to create another WF on Create event of the Opportunity in which you will just call the manual WF.

recursive-workflow-recursive-reminders-4.jpg

Remember to activate both the workflows. Your reminders are working now.

Thoughts about questions and answers in newsgroups

Few days back, i had a little discussion with Michael Hohne (www.stunnware.com). (btw, if you don’t know Michael than you have never searched on the web on Mirosoft CRM)

Do visit his website for the basic guidline for the solution providers on different forums & newsgroups;

 http://www.stunnware.com/crm2/topic.aspx?id=NewsgroupPost

How to change the default entity in LOOKUP window?

For instance, in Opportunity form of Microsoft CRM you want to change the “Potential Customer” field’s default entity from Account to Contact. You need to use the following piece of code in onLoad event of the Opportunity Form.

if ( crmForm.all.customerid != null )
{
    crmForm.all.customerid .setAttribute(”defaulttype”, “2″);
}

Remember to enable the event and then save and publish the opportunity entity.

 Following are codes of basic entities of Microsoft CRM 3 ;

  • Account    1
  • Contact     2
  • Lead         4

Follow

Get every new post delivered to your Inbox.