CRM 4: IFD Authentication using C#

Posted by on Apr 14, 2010 in CRM 4.0, Plug-ins |

A very common question is: “How do i run a plugin/custom web application against a IFD deployment?”

You should use the below code:

Code: ifd-service-auth-code.txt

Read More

Recommended Microsoft CRM 4.0 Books

Posted by on May 23, 2009 in CRM 4.0, Customizations, Deployment, General, Licensing, Plug-ins, SDK |

Hi All,

I would like to recommend to you some of the books i have read in regards to Microsoft Dynamics CRM 4.0.

Working with Microsoft Dynamics(TM) CRM 4.0 (Paperback)

Working with Microsoft Dynamics CRM 4.0
by Jim Steger (Author), Mike Snyder (Author)

Product Description
Get a practical introduction to Microsoft Dynamics CRM now updated for Microsoft Dynamics CRM 4.0. Microsoft Dynamics CRM is a value-packed customer-relationship management (CRM) solution for small- and mid-market businesses. The latest version adds workflow management capabilities, and will be delivered as an on-demand service through Microsoft® Office Live. With topics that include developing new functionality, designing implementations, and integrating Microsoft CRM with other business applications including Microsoft Office Outlook®, Microsoft Office InfoPath®, and Microsoft SharePoint® Products and Technologies this is one of the only books written for both developers and those who implement business solutions. Authored by experienced practitioners, this book provides case studies, integration and performance guidelines, and toolsets the information you need to help you create successful CRM solutions. This book also explains how to maintain Microsoft Dynamics CRM 4.0, making it of interest to IT professionals who support Microsoft Dynamics CRM 4.0 users. And power users will learn how to customize individual Microsoft Dynamics CRM 4.0 experiences. Key Book Benefits: Delivers practical information from expert authors who have deployed, customized, and maintained Microsoft Dynamics CRM in the field Provides case studies, integration and performance guidelines, and toolsets Includes code samples, and demo data will be available on the Web

About the Author
Mike Snyder and Jim Steger are co-founders and principals at Sonoma Partners, a consulting firm specializing in Microsoft CRM implementations. Sonoma Partners was named top Global Microsoft CRM Partner in 2003 and 2005. Recognized as one of the industry s leading CRM experts, Mike authors several popular newsletters and blogs about Microsoft CRM. Jim architected and led multiple award-winning Microsoft CRM deployments, including complex enterprise integration projects. He s been developing and writing code for Microsoft CRM since the version 1.0 beta.

More info:

Microsoft Dynamics CRM 4.0 Unleashed (Paperback)

MSCRM Unleashed

by Marc J. Wolenik (Author), Damian Sinay (Author)

Product Description

Microsoft® Dynamics CRM 4.0 Unleashed presents start-to-finish guidance for planning, customizing, deploying, integrating, and managing Dynamics CRM in your unique business and technical environment. Authored by two leading Microsoft Dynamics implementers, this book systematically explains how the system works, why it works that way, and how you can leverage it to its fullest advantage.


The authors present clear examples, proven best practices, and pitfalls to avoid in using every significant Dynamics CRM capability. The far-reaching coverage ranges from Dynamics CRM’s sales, marketing, and customer service features to its automated workflows; from Outlook and Office integration to reporting and security. The authors offer independent insight into Dynamics CRM’s most powerful new features, from its improved interface to its new mail merge and data migration tools.


This book is for every IT professional who intends to work with Dynamics CRM, regardless of their experience with Dynamics or other CRM solutions. The authors provide example-rich, realistic coverage of advanced Dynamics customization, extensibility, and integration: information that is available nowhere else.


Detailed information on how to…

  • Set up, configure, and maintain all facets of Dynamics CRM in any organization or industry
  • Thoroughly understand both the on-premise and hosted versions of Dynamics CRM
  • Make the most of Dynamics’ new features, including email, the Outlook client, Internet Facing Deployment (IFD), and relationships
  • Manage sales leads, opportunities, accounts, contacts, marketing lists, sales collateral, campaigns, quotes, orders, and invoices
  • Improve customer service by integrating schedules, cases, contacts, product/service information, and more
  • Build powerful automated workflows that streamline key sales tasks and liberate salespeople for more effective selling
  • Efficiently administer and secure any Dynamics CRM implementation
  • Drive greater value by integrating Dynamics CRM with Microsoft Office productivity tools
  • Customize and extend Dynamics CRM using Visual Studio, .NET, and custom plug-ins and add-ons


Download all of this book’s examples and source code at

About the Author

Marc J. Wolenikis founder and CEO of Webfortis, a Northern California consulting company and Microsoft Gold Certified Partner that specializes in solutions built with Dynamics CRM. He has extensive experience with CRM implementation, integration, and migration for companies of all sizes, and is deeply involved in building custom vertical solutions around the Dynamics platform.


Damian Sinayis a Webfortis partner. Currently a development manager with senior .NET development responsibilities, he has extensive experience working with all Dynamics CRM technologies. He has participated in Dynamics CRM projects involving extremely complex customizations, integrations, and implementations.


More info:

Programming Microsoft Dynamics CRM 4.0 (Pro-Developer)

programing ms crm 4.0

by Mike Snyder (Author), Jim Steger (Author), Brad Bosak (Author), Corey O’Brien (Author), Phil Richardson (Author)

Product Description
Announcing a fully revised second edition of this popular SELF-PACED TRAINING KIT designed to help maximize your performance on 70-536, a core exam for the MCTS and MCPD certifications. This 2-in-1 kit includes the official Microsoft study guide, plus practice tests on CD to help you assess your skills. It comes packed with the tools and features exam candidates want most including in-depth, self-paced training based on final exam content; rigorous, objective-by-objective review; exam tips from expert, exam-certified authors; and customizable testing options. It also provides real-world scenarios, case study examples, and troubleshooting labs for the skills and expertise you can apply to the job. Focusing on the fundamentals of .NET application development, this official study guide covers using system types, collections, and generics to help manage data; validating input, reformatting text, and extracting data with regular expressions; developing services, application domains, and multithreaded applications; enhancing your applications by adding graphics and images; implementing code access security, role-based security, and data encryption; working with serialization and reflection techniques; instrumenting your applications with logging and tracing; and interacting with legacy code using COM Interop and PInvoke. Work at your own pace through the lessons and lab exercises. Then assess yourself using 300+ practice and review questions on the CD, featuring multiple, customizable testing options to meet your specific needs. Choose timed or untimed testing mode, generate random tests, or focus on discrete objectives. You get detailed explanations for right and wrong answers including pointers back to the book for further study. You also get an evaluation version of Microsoft Visual Studio® 2008 software and an exam discount voucher making this kit an exceptional value and a great career investment.

Key Book Benefits

Comprehensive exam prep study guide In-depth coverage of exam objectives and sub-objectives plus instructive case studies and troubleshooting scenarios to enhance your performance on the job 300+ practice and review questions Test engine that enables customized testing, pre-assessment and post-assessment, and automated scoring and feedback Microsoft Visual Basic and Visual C# code samples on CD Handy exam-mapping grid Evaluation version of Visual Studio 2008 software 15 percent exam-discount voucher from Microsoft (limited time offer) Entire study guide in searchable eBook format

About the Author
Tony Northrup, MCTS, MCSE, CISSP, and Microsoft MVP, is a consultant and author. He is coauthor of the SELF-PACED TRAINING KITS for a wide range of .NET Framework, Windows Server 2008, Windows Vista, and Windows XP certification exams.

More info:

Read More

Company name on the phone call form.

Posted by on Sep 18, 2008 in CRM 4.0, Customizations, Plug-ins |

Hi there,

Have you struggled without the company name on the phone call form in CRM 4.0??

Usually when you create phonecall campaigns you notice that the regarding field of the campaign is the ‘Campaign Name’ and the Recipient is the ‘Lead full name’ which leaves us with no information what so ever telling us the company name.

This proccess involves creating a plug-in in Visual Studio 2005 or 2008 (what i use).

Step 1 – Creating custom attribute:

  • Create a custom attribute on the phone call form and call it ‘Company (Lead)’and stick this on the form. 
this is the custom attribute
this is the custom attribute

Step 2 – Creating Project:

  • Open up visual create and create a ‘Class Library Project’ and call it ‘GetCompanyPhoneCall’
  • Right click the project and click properties then click on the ‘Signing’ Tab on the left hand side.
  • Check the box: ‘Sign this assembly’, click on the drop down and select new and name it ‘SignedCRM’ and uncheck the ‘Protect the key file with a password’

Step 3 – Coding:

  • Insert the following code onto the page (you should delete everything that is currently on there minus what you just inputed. The code should look like the following.

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Crm.Sdk;
using Microsoft.Crm.SdkTypeProxy;
namespace Microsoft.Crm.Sdk.Walkthrough
 // this is the phone call update plugin.
    public class PhoneCallUpdateHandler : IPlugin
        public void Execute(IPluginExecutionContext context)
            // define a new Dynamic Entity as null

            DynamicEntity entity = null;

            // Check if the input parameters property bag contains a target
            // of the update operation and that target is of type DynamicEntity.

            if (context.InputParameters.Properties.Contains(“Target”) &&
               context.InputParameters.Properties[“Target”] is DynamicEntity)
                // Obtain the target business entity from the input parmameters.
                entity = (DynamicEntity)context.InputParameters.Properties[“Target”];

                // Verify that the entity represents a phonecall.
                if (entity.Name != EntityName.phonecall.ToString()) { return; }

            { return; }


                //we check if the category is empty then continue, else we stop.
                if (entity.Properties.Contains(“new_leadcompany”) == false)
                    if (entity.Properties.Contains(“to”) != false)

                        // Start the Service request
                        ICrmService service = context.CreateCrmService(true);

                        // this code works to simply display the GUID of the current record (phone call)!!!!!!! Guid boy = (Guid)context.OutputParameters.Properties[“id”];
                        // Note: the “to” field is a array of Dynamic entities — who knew!!
                        // First define a recipients for this Dynamic Entity array

                        DynamicEntity[] recipients = null;

                        // assign the “to” field on the form to the new array
                        recipients = (DynamicEntity[])entity.Properties[“to”];

                        //iterate through the recipients in the field and take the first lead that is available
                        foreach (DynamicEntity recipient in recipients)
                            Lookup recipientType = (Lookup)recipient.Properties[“partyid”];

                            // checking if the type is Lead
                            if (recipientType.type == “lead”)
                                // each array member is an ActivityParty — which then points to the Lead
                                // to get the Lead Guid, lookup on the “partyid” field
                                Guid recipientGuid = ((Lookup)recipient.Properties[“partyid”]).Value;

                                // now retrieve the Lead record, using the std entity name, the GUID you just got, and ask for all columns

                                lead retrieveLead = service.Retrieve(EntityName.lead.ToString(), recipientGuid, new Query.ColumnSet(new String[] { “leadid”, “companyname” })) as lead;

                                if (retrieveLead != null)
                                    //then input the company name into the category field
                                    entity.Properties.Add(new StringProperty(“new_leadcompany”, retrieveLead.companyname));

                else { return; }

            // this is the exception thrown if there is an error
            catch (System.Web.Services.Protocols.SoapException ex)
                throw new InvalidPluginExecutionException(“An error occurred in the AccountCreateHandler plug-in.”, ex);
The code above is self-explanatory, i have commented most of it for you guys to understand.

  • Next step is to register the plug-in using the plug-in registration tool.
  • Click on the ‘register’ menu and click ‘register new assembly’
  • Load the DLL file located in the project/bin folder
  • When done, click on the new assembly and right click and click ‘Register new step’

Message: update

Primary entity: phonecall

Pipeline Excution: pre-stage

  • Click register and exit. now create a new phone call with the ‘Lead’ as the recipient & Click Save. The turn out should be similar to below:

That concludes this post. If you need some help, don’t hesitate to comment on this post.

-MSCRM Person

Read More

Welcome to

Posted by on Aug 12, 2008 in CRM 4.0, Customizations, Deployment, General, JavaScript, Licensing, Plug-ins, SDK |

Hi Guys,

Welcome to my new Blog. My name is Ibrahim Sukari (refer to the About Me page for more info), i am a CRM developer. The company i work for is called RightServ. We have done quiet a few CRM deployments with hefty customizations. I basically created this blog to give back to the community that indeed helped me during those tough deployments. I’ll be posting a range of stuff including code and how-to’s. I want this blog to be on top and become a ALL-IN-ONE resource for Microsoft Dynamics CRM!


Read More
%d bloggers like this: