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 https://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

Advertisements

13 Comments

  1. mohan said,

    January 7, 2010 at 3:13 am

    Hi Umar,

    could you please send me this code or atleast the elobarate the solution this is what i needed buddy!

    • mohan said,

      January 11, 2010 at 2:57 pm

      Hi Umar,could you please send me this code or atleast the elobarate the solution this is what i needed

      please respond me and help me

  2. January 15, 2013 at 7:53 am

    I personally desire to save this specific posting, “Implementing Approval Verification Processes uMar Khan :
    : MS CRM” on my personal internet site.
    Do you really mind if I actuallydo? Regards -Elana

  3. February 26, 2013 at 10:46 am

    Hello! I just wanted to ask if you ever have
    any problems with hackers? My last blog (wordpress) was
    hacked and I ended up losing many months of hard work due
    to no backup. Do you have any solutions to stop hackers?

  4. Shenna said,

    April 27, 2013 at 2:12 am

    I was very happy to uncover this website. I need to to thank you for your time for this wonderful read!

    ! I definitely loved every bit of it and i also have you bookmarked to check out new things in your web site.

  5. nakne piker said,

    May 5, 2013 at 5:43 pm

    På knull kontakt kan single finne oppegående sexpartnere som kun er ute etter erotiske eventyr, og
    dette med noen som deler samme preferanser som dem.
    Det er de tingene vi vanligvis tenner på og fantaserer om.
    På knull kontakt finner du helt sikkert damer som har lyst på det samme som
    deg og som kan tenke seg å ha en het One Night Stand ute i naturen
    sammen med deg.

  6. Clayton said,

    May 24, 2013 at 4:34 pm

    Whats up this is somewhat of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code
    with HTML. I’m starting a blog soon but have no coding experience so I wanted to get guidance from someone with experience. Any help would be enormously appreciated!

  7. August 4, 2013 at 7:12 am

    My brother recommended I would possibly like this blog.
    He was once entirely right. This put up actually made my day.
    You cann’t believe just how so much time I had spent for this info! Thanks!

  8. Flo said,

    September 9, 2013 at 11:14 pm

    Hello,

    I would please like to ask if I can use the above solution in CRM 2011.

    Thank you very much for your help in advance.

  9. September 17, 2013 at 1:39 am

    こんなイベントが組めるなんてスゴイ。
    膝を出すのには勇気が・・・

  10. October 6, 2014 at 4:13 am

    Besides being the most important need of man, food is
    actually the best aspect to come together with friends, family
    members and sit across the table. You can also pick up fresh
    flowers at the market, either already arranged in a fall bouquet or simply do-it-yourself with a couple
    different types of roses, sunflowers and dahlias.
    You can utilize these shelves to present
    an astonishing display of your audio and other multi media
    devices that you own.

  11. Barrett said,

    August 9, 2016 at 10:47 am

    I feel this is among the such a lot significant info for me.
    And i am satisfied studying your article. But should observation on few general things, The website style is perfect,
    the articles is actually nice : D. Just right job,
    cheers

  12. Moises said,

    August 21, 2016 at 1:19 am

    Players whether they’re member or nonmember, both can participate particular assignments
    so they can gain some rewards.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: