Welcome to our website

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ed ut perspiciatis unde omnis iste.

Freitag, 17. Juni 2011

Warum Microsoft Dynamics Hosted CRM 2011 (IFD /Claims based Authentification)

Warum Microsoft Dynamics Hosted CRM 2011 (IFD /Claims based Authentification)

vom Experten hosten lassen? Die Vorteile von Microsoft Dynamics Hosted CRM 2011

Hoster bieten Ihnen Microsoft Dynamics Hosted CRM 2011 ohne die sonst notwendigen Investitionen. Entgegen einer normalen Microsoft Dynamics CRM 2011 Installation sind Sie  mit Microsoft Dynamics Hosted CRM 2011 in der Lage Ihre Dynamics CRM 2011 Lösung innerhalb von wenigen Stunden zu erhalten. Bei Microsoft Dynamics Hosted CRM 2011 Variante bezahlen Sie nur das, was Sie auch benötigen und haben keinerlei Aufwand in Hardware und Installation.

Microsoft Dynamics Hosted CRM 2011 (Dynamics CRM 2011 aus der Cloud)

 keine Investitionen für eigene Hard- und Software für Ihr Dynamics CRRM 2011
 keine hohen Betriebskosten für interne Server (Strom, Kühlung, Backups etc.)
 keine ungeplanten Kosten für Service oder Support für Dynamics CRM 2011
 24/7-Serverüberwachung durch Experten
 schnelle Einrichtung, Unterstützung durch Experten (keine Hotline)
 durch viele Add-ons und Zusatzfunktionen komplett integrierbar in Dynamics CRM 2011
 Pay per Use Prinzip - zahlen Sie nur die User, die Sie brauchen
 bei Bedarf jederzeit an die aktuellen Bedürfnisse im Unternehmen anpassbar

Fordern Sie nun Ihren kostenlosen Testzugang an!


einfach auf das Bild klicken

Configuring Hosted/IFD with Microsoft Dynamics CRM 2011 (Hosted Microsoft Dynamics CRM 2011)

Configuring Hosted/IFD (Internet Facing Deployment)with Microsoft Dynamics CRM 2011 (Hosted Microsoft Dynamics CRM 2011
As many of our early adopters have learned by now, configuring an Internet-facing deployment (IFD) has changed pretty drastically from Microsoft Dynamics CRM 4.0 to Microsoft Dynamics CRM 2011. ((Internet Facing Deployment)with Microsoft Dynamics CRM 2011)
So what changed?
  • First, our dependencies changed. In Microsoft Dynamics CRM 4.0, we used forms-based authentication for IFD and in Microsoft Dynamics CRM 2011 we instead take a dependency on claims-based authentication for IFD. Therefore, now it is necessary to install and configure a security token service (such as Active Directory Federation Services 2.0) and also to do more certificate management.
  • Second, our configuration steps changed. In Dynamics CRM 4.0, an administrator had two options for configuring IFD. The first option was to specify the IFD settings in an XML configuration file at server installation time. The second option was to use the IFD Configuration Tool for Microsoft Dynamics CRM 2011 which was released out of band. In Microsoft Dynamics CRM 2011, we made claims-based authentication and IFD configuration post-installation steps to obviate the need for the XML configuration file and built these wizards into our Deployment Manager tool for Microsoft Dynamics CRM 2011. Administrators that would prefer to script IFD configuration can do so using our new Dynamics CRM PowerShell cmdlets.
These changes amount to a higher learning curve for configuring IFD for Microsoft Dynamics CRM 2011 as we have heard in feedback from partners and customers. So to help make this configuration a little easier for folks, Henning Petersen (a Support Escalation Engineer for Dynamics CRM) created a video demonstrating how to configure IFD with AD FS 2.0. In addition to this video, we recommend that people looking to configure IFD first review the Dynamics CRM 2011 Configuring Claims-Based Authentication white paper which is posted on the same page as our Dynamics CRM 2011 Implementation Guide.
This video is  called Introducing Microsoft Dynamics CRM 2011 Claims-based Authentication and covers the end-to-end process for configuring IFD which includes:
  1. Installing AD FS 2.0
  2. Configuring the AD FS 2.0 federation server
  3. Managing certificates
  4. Configuring Dynamics CRM 2011 for claims-based authentication and IFD
  5. Creating the relying party trust for CRM and configuring the claims rules on AD FS 2.0
-> In the next posts we will talk about the Configuration of Hosted/IFD with Microsoft Dynamics CRM 2011 for Service Providers Hosters.

CRM MVP Julie Yack announces the release of her current whitepaper for tech nerds. Julie blogs regularly at The never boring life of me.
Looking for details on Microsoft Dynamics CRM 2011 and how it applies to you as an Independent Software Vendor (ISV), a technical decision-maker and/or a developer?  Are you a curious nerd looking for what’s new?  Here you go!
Ok, so here’s some of the nitty gritty details…
Paper is titled:
Microsoft Dynamics® CRM 2011
Building Business Applications with Microsoft Dynamics CRM 2011
A guide to Independent Software Vendors and Developers
Some details you can learn about:
  • Modeling of your business data
  • A better user experience
  • Visualization and reporting of data
  • Programmability including OData, WCF, LINQ, Dialogs, Workflows and more
  • Cloud cloud cloud (CRM Online and Azure both covered)
Brought to you by a couple of your favorite (I hope) CRM nerds, David Yack and me. We were asked to write this paper to follow-up on the one we produced for the similar topics for CRM 4.0.
I hope you find something useful inside this whitepaper download.

Donnerstag, 16. Juni 2011


Project Description
CRM 4 to CRM 2011 Javascript Converter helps convert scripts to the latest CRM 2011 Form scripting model. The converter uses an xml file that contains CRM4 and CRM5 nodes which allow the converter to find/replace specific instances of text. For further details please see the documentation area.

Usage
Simply paste your CRM 4 script into the left hand text area and click Convert.
CRM 4 to CRM 2011 Converter Tool

CRM 2011 – JScript IntelliSense for Form Script Libraries in version 5.0.3

CRM 2011 – JScript IntelliSense for Form Script Libraries in version 5.0.3



A fantastic blog entry from the Microsoft Dynamics CRM blog today about Jscript Intellisense for Form Script Libraries, click here to read it. Sometimes I wonder why you need to keep updating your version of CRM 2011 but then when I read the goodies they have added into the latest version, I then want to upgrade.
The blog post also led me to a page I hadn’t seen JScript Intellisense Overview and it also has an interesting page Walkthrough:Jscript Intellisense
it is a really in depth blog entry about how they added in JScript Intellisense with the new release of SDK 5.03, here is a brief quote from the blog post
In the latest release of the Microsoft Dynamics SDK (Version 5.0.3) you will find a Microsoft Dynamics CRM Solution and Visual Studio extension that together will provide IntelliSense support for the Xrm.Page object in form scripts. I hope that this solution will help make your process of creating form scripts using the Xrm.Page object more productive. The result is that you can have IntelliSense that provides auto completion and documentation about the methods as shown below:
image
The SDK\Templates\Xrm.PageScriptProjectTemplate\Readme.docx file in the download package provides details about installing and using the solution. Rather than repeat what you can find there, in this post I will describe the process of creating this solution and I hope to set your expectations for what the solution offers.

Useful Form Scripts #5: Role-Tailored Forms

Useful Form Scripts #5: Role-Tailored Forms

The Problem: (Only) One Form per Entity

There are lots of ways you can customize Dynamics CRM 4.0. For example, you can add custom attributes to system entities, you can add custom entities, you can customize relationships between entities, you can customize forms and views, and you can add custom views.Topics like the one in this article — plus ASP.NET development, Plug-Ins and more — are covered in my one-day live online training class, Extending Dynamics CRM
But you cannot add custom forms: every customizable entity in Dynamics CRM has one form which you can customize, but you can’t add a new form. This one-form-per-entity rule seems restrictive, especially if you’re new to CRM and moving over from a platform without that limitation.
While it’s true you can only create one form per entity, it’s not true that all users must see the same version of the form. With the technique I describe here, you can create a role-tailored experience for your users, which can be an important contributor to user satisfaction, user adoption, and overall CRM success.
Here are a couple scenarios that might call for role-tailored Dynamics CRM forms:
  • In a sales scenario, an outside rep might be the rainmaker, playing golf, doing deals, no need or time for lots of details. The outside rep might be paired with a cube-bound inside rep, who really does need the detail, some of which can be expressed on a more complex form for the opportunity entity.
  • In a service scenario, it might go the other way: a level 1 case is handled by a junior service rep, who handles the simpler cases and escalates the complicated ones to a manager. Escalated cases tend to be more complex, and the manager might require a more detailed form experience when working with service cases.

The Solution: Dynamic Forms Based on Security Roles

I wrote briefly about this problem in an earlier article but I didn’t include the entire code listing. Partly because a few readers asked me for a full sample, and partly because I wanted it for my own reference, here’s a complete listing and a more complete explanation.
JavaScript can be run on a form’s OnLoad event, it can check to see which user’s loading the form, and it can present a dynamically tailored form to a user or group of users. It can also check the current state of the record – the value of certain fields, for example – and incorporate that information to tailor a form appropriately. In the example I’ll show here, an important feature is the WhoAmI method of the CrmService web service. You can use it to query the security role of the current user, and provided you can use security roles to drive the form experience, this technique can work pretty well.
The following code can go in the OnLoad event of an un-customized Opportunity form. (I’ll list and explain it in three separate sections, but if you want to copy it to the clipboard and try it yourself, remember that the way I wrote it, all three sections need to be pasted, successively, into the OnLoad event of Opportunity.)

Section 1: test for user’s security roles and show appropriate version of form:

This section calls the UserHasRole function, which is in section 2.
if (UserHasRole("Outside Sales")) {
    //hide default Administration and Notes tabs:
    crmForm.all.tab1Tab.style.visibility = "hidden";
    crmForm.all.tab2Tab.style.visibility = "hidden";
    //hide default probability, price list, rating and currency fields
    crmForm.all.closeprobability_c.style.visibility = "hidden";
    crmForm.all.closeprobability_d.style.visibility = "hidden";
    crmForm.all.pricelevelid_c.style.visibility = "hidden";
    crmForm.all.pricelevelid_d.style.visibility = "hidden";
    crmForm.all.opportunityratingcode_c.style.visibility = "hidden";
    crmForm.all.opportunityratingcode_d.style.visibility = "hidden";
    crmForm.all.transactioncurrencyid_c.style.visibility = "hidden";
    crmForm.all.transactioncurrencyid_d.style.visibility = "hidden";
}

Section 2: The UserHasRole function

This convenient wrapper function and the one in the next section are taken, unchanged, from Jim Wang’s excellent article, Check current user’s security role using JavaScript.
function UserHasRole(roleName) {
    //get Current User Roles, oXml is an object
    var oXml = GetCurrentUserRoles();
    if (oXml != null) {
        //select the node text
        var roles = oXml.selectNodes("//BusinessEntity/q1:name");
        if (roles != null) {
            for (i = 0; i < roles.length; i++) {
                if (roles[i].text == roleName) {
                    //return true if user has this role
                    return true;
                }
            }
        }
    }
    //otherwise return false
    return false;
}

Section 3: GetCurrentUserRoles

This part does the heavy lifting. It constructs a SOAP message in the form of a big honkin’ text string — that’s the xml variable — that eventually gets passed through to the RetrieveMultiple method of the CrmService web service and returns the result. To really understand what’s going on in here, use the Visual Studio debugging technique I described in Useful Form Scripts #3.
function GetCurrentUserRoles() {
    var xml = "" +
 "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
 "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">" +
 GenerateAuthenticationHeader() +
 " <soap:Body>" +
 " <RetrieveMultiple xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">" +
 " <query xmlns:q1=\"http://schemas.microsoft.com/crm/2006/Query\" xsi:type=\"q1:QueryExpression\">" +
 " <q1:EntityName>role</q1:EntityName>" +
 " <q1:ColumnSet xsi:type=\"q1:ColumnSet\">" +
 " <q1:Attributes>" +
 " <q1:Attribute>name</q1:Attribute>" +
 " </q1:Attributes>" +
 " </q1:ColumnSet>" +
 " <q1:Distinct>false</q1:Distinct>" +
 " <q1:LinkEntities>" +
 " <q1:LinkEntity>" +
 " <q1:LinkFromAttributeName>roleid</q1:LinkFromAttributeName>" +
 " <q1:LinkFromEntityName>role</q1:LinkFromEntityName>" +
 " <q1:LinkToEntityName>systemuserroles</q1:LinkToEntityName>" +
 " <q1:LinkToAttributeName>roleid</q1:LinkToAttributeName>" +
 " <q1:JoinOperator>Inner</q1:JoinOperator>" +
 " <q1:LinkEntities>" +
 " <q1:LinkEntity>" +
 " <q1:LinkFromAttributeName>systemuserid</q1:LinkFromAttributeName>" +
 " <q1:LinkFromEntityName>systemuserroles</q1:LinkFromEntityName>" +
 " <q1:LinkToEntityName>systemuser</q1:LinkToEntityName>" +
 " <q1:LinkToAttributeName>systemuserid</q1:LinkToAttributeName>" +
 " <q1:JoinOperator>Inner</q1:JoinOperator>" +
 " <q1:LinkCriteria>" +
 " <q1:FilterOperator>And</q1:FilterOperator>" +
 " <q1:Conditions>" +
 " <q1:Condition>" +
 " <q1:AttributeName>systemuserid</q1:AttributeName>" +
 " <q1:Operator>EqualUserId</q1:Operator>" +
 " </q1:Condition>" +
 " </q1:Conditions>" +
 " </q1:LinkCriteria>" +
 " </q1:LinkEntity>" +
 " </q1:LinkEntities>" +
 " </q1:LinkEntity>" +
 " </q1:LinkEntities>" +
 " </query>" +
 " </RetrieveMultiple>" +
 " </soap:Body>" +
 "</soap:Envelope>" +
 "";
var xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
xmlHttpRequest.Open("POST", "/mscrmservices/2007/CrmService.asmx", false);
    xmlHttpRequest.setRequestHeader("SOAPAction", " http://schemas.microsoft.com/crm/2007/WebServices/RetrieveMultiple");
    xmlHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    xmlHttpRequest.setRequestHeader("Content-Length", xml.length);
    xmlHttpRequest.send(xml);
var resultXml = xmlHttpRequest.responseXML;
    return (resultXml);
}

How it Works

It’s easiest to test this if you’re running CRM as a system administrator — or more precisely, if one of the security roles assigned to your user account is the “System Administrator” role. You can test it yourself by following these steps:
1. Start by copying the code blocks in each of those three sections, one after the other, into the OnLoad event code of Opportunity. Make sure the “Event is enabled” checkbox is selected, then publish the customizations.
2. Add a custom security role, “Outside Sales”. If you’re in the System Administrator role, it doesn’t even matter if this custom role has any permissions or not — all that matters for the purpose of testing this code is that you’re assigned to a role with that name. Open an existing or a new opportunity – should be the same experience either way — and you should see the simplified version of the form:
RoleTailored2
3. Next, open up your user form and remove that role. The next time you open the opportunity form you’ll see the “normal” opportunity form…or whatever version of it you’d normally see:
RoleTailored1
Remember: the code specifically refers to the Price List, Rating, and Probability fields, so if you’re working with an already-customized version of the form you’ll need to tweak it a little bit.
This example is somewhat simplistic and not intended as an exercise in best-practice CRM form design, but it does illustrate some interesting points:
  • You don’t really have to display the Administration and Notes tabs — you can save a record fine without them, since all the required fields have default values filled in.
  • Hiding fields is a little hinky:
    crmForm.all.opportunityratingcode_c.style.visibility = "hidden";
    hides the label of the opportunityratingcode field, and
    crmForm.all.opportunityratingcode_c.style.visibility = "hidden";
    hides the data. Plus, whereas when you hide a section the sections underenath it move up so there’s no holes on the form, that isn’t the case with fields. There are certainly other ways to do this, but worst case you could create separate sections with no labels to contain fields you wanted to hide, and then just hide the sections.

Re-usable JScript Libraries in Dynamics CRM 2011

Re-usable JScript Libraries in Dynamics CRM 2011

Introduction: Web Resources and JScript Libraries

One of the most remarkable improvements in Dynamics CRM 2011 is the broadened scope for “declarative customizations” – i.e., those not requiring code. If you’re just starting out with the new version and have some customization experience with CRM 4.0, a good place to see this is in working with lookups. Nearly every day I discover a useful application that required code in CRM 4.0 but can be done in CRM 2011 entirely by customizing properties of the new and improved lookup field.
Topics like the one I present here are covered in my subscription series of 4-hour training sessions, Dynamics CRM 2011 Essentials. Find out more and register here…
For example, check out the code required to create a filtered lookup in CRM 4.0 and then compare it to the no-code-form-editor-only approach in CRM 2011 (the latter example is illustrated in the demo at the end of the article).
That being said…there are still plenty of situations requiring some code. Fortunately, when you run into one of these, the improvements in CRM 2011 are just as significant. The ones I want to talk about here – re-usable libraries of JScript code – are part of a brand-new construct known as a “web resource”. Think of web resources as virtual files: resources that can be stored in the CRM 2011 database that in CRM 4.0 would have required a physical disk file. I presented an introductory session at the recent Extreme 2010 show on web resources, and wrote up a summary article here.
In this article I return to the “useful CRM form scripts” theme of the articles you’ll find this in the Trick Bag’s form scripts category: this article is effectively the “hello world” version of working with form scripts in CRM 2011. My experience is that the CRM 2011 approach is different enough from CRM 4.0 that there’s a short, sharp learning curve; hopefully this article will help. The good news is, once you get used to working with JScript web resources, you’ll find that the benefits of having re-usable libraries of form script functions will far outweigh the costs of learning how they work!
If you ever wrote CRM 4.0 form script to turn a phone number entered like this – 6306667667 – into something like this – (630)666-7667 – you probably started by grabbing code from somewhere on the web or something you’d written previously, and placing it on the Change event of the phone number field on a form. The account entity has ten phone number fields (including fax numbers) and the contact entity (including pager numbers) probably has more. So if you implemented this on 20 fields and then had to fix a bug…you had your work cut out for you!
There were techniques in CRM 4.0 to make this a little easier:
  1. You could place a single function in the load event of a form and then call that function from the change event of a form field.
  2. You could actually create a library of re-usable JScript functions, placed by convention in the ISV folder on your CRM server.
Both of these had problems, though: The first one only works for a single entity, so you’d still have to make changes in multiple places. The second involved a fair amount of plumbing to set it up, and created a pretty serious feature gap between CRM Online and on-premise.
In the next section I’ll focus on the mechanics of creating JScript libraries and calling their functions; if you already know the basics and want to see the FormatPhoneNumber bit, skip to the following section.

Example: CRM 2011 Hello World

How do you create your first JScript library and call a function? Here’s a step-by-step hello world example, assuming you’re a user with something like the System Administrator security role:
  1. On the site map, click Settings, and then click Customizations.
  2. On the Customizations page, click Customize the System.
  3. In left navigation, click Web Resources, and then click New.
  4. In the Web Resource dialog, type a Name and a Display Name. (The Name is the schema name, so it can’t have spaces or special characters.)
  5. In the Type drop-down, select Script, and then click Save.

    At this point you can browse out to disk and upload a file if you have one. If you’re just starting out, however, you might not have one that will work, because the new object model in CRM 2011 requires some slight differences in the JScript code. In any event, this is the “hello world” example, so I’ll take a shortcut:
  6. Rather than uploading a file, you can simply click the Text Editor button to open up the default editor. What you’re creating in here is the function that will be called from a form event – that is, will be identified as the “event handler” for a form event. To focus specifically on the mechanics, here’s as simple an example as I can come up with:



    This shows what it might look like after you clicked the Text Editor button and wrote your function.
  7. Click OK to save the function, then click Save & Close in the Web Resource window.
  8. Web resources need to be published in order to use them, so with your web resource selected in the list, click Publish on the toolbar.
Now that your function’s ready to use, how do you use it? To illustrate the point that functions contained within a Script web resource are re-usable across any entity form in your CRM, I’ll do the next step-by-step generically. Just think: with the exact same code you can provide your users a cheery greeting regardless of which entity’s form they happen to be opening!!! J

  1. Navigate to the grid for any record type, and click the Customize tab on the ribbon.
  2. In the Design group, click Form. The form editor opens.
  3. Click Form Properties in the Form group.
  4. In the Form Libraries section, click Add. The Look Up Record dialog should appear and you should see your JScript library. (This lookup is context sensitive and in this context knows the only kind of web resource that can go here is a JScript library.) In my example, it looks like this:


  5. Select it and click OK. All functions contained in that library are now available as event handlers for any control on the form. (You can have multiple form libraries for a single form, as well as multiple handlers for a single control on the form.)
  6. To call the function, scroll down to the Event Handlers section. Click the Control drop-down, and notice that you can select ANY control on the form right from here: even though this dialog is for form properties, you aren’t restricted to only accessing the OnLoad and OnChange events for the form as in CRM 4.0
  7. But for this example, I’ll stick to the form load: select Form in the Control list, OnLoad in the Event list, and then click the Add button.
  8. You need to type the name of the function (remember JScript is case-sensitive) in the Function field, and then click the Enabled checkbox:


  9. Now click OK, then OK again to close out the Form Properties dialog. Preview the function from within the form editor to see how it works.

Example: FormatPhoneNumber

OK, now that we’ve seen how the mechanics work, let’s do something useful! For the step-by-step example I’ll do next, I’m going to take a slightly different approach that will end up with the same result: I’ll start out from the account form, and create the JScript Library web resource on the fly, illustrating another good example of “in-place” customization. But the library I create will be equally accessible from any entity in CRM, and the FormatPhoneNumber function is written so it can be called from any phone number field.
  1. Navigate to the accounts grid, and click the Customize tab on the ribbon.
  2. In the Design group, click Form.
  3. In the Form group, click Form Properties, and then in the Form Properties dialog, click Add in the Form Libraries section.
  4. In the Look Up Record dialog, click New. (This is the “creating it on the fly” part.) The Web Resource: New window appears. I’ll call mine “CommonFunctions”, with an appropriate Display Name, select Script (JScript) in the Type drop-down, and then click Save:

Click Text Editor, and enter the code you see in the following screenshot:

A couple quick points about this JScript function:

A couple quick points about this JScript function:
  • Even if I have a disk file I could upload, it’s just as easy to copy it to the clipboard and then paste it into the editor.
  • Notice the “context” parameter. This is important if the function is intended for re-use; you’ll see that in a minute when we call it as an event handler.

  1. Click OK to save the function, and then click Publish in the Actions group on the Web Resource ribbon. Even though I did this from within Account, it will be published as a web resource available from anywhere. Then click Save and Close to close out of the web resource window, and you should be back in the Look Up Record dialog (remember? From step 4 above.)
  2. Then select the function library and click OK, and you should be back on the Form Properties dialog, with your function library added as an available library:


    Now you have a couple options: you can either click OK to return to the form editor and locate the phone number fields you want to use the function on, OR do it the cool new time-saving way I’ll do here:
  3. Keep the Form Properties dialog open and select Main Phone in the control list.
  4. Then click Add in the Event Handlers section to open the Handler Properties dialog.
  5. Type the function name – FormatPhoneNumber – in the Function field, click the Enabled checkbox, and make sure this time to click the Pass execution context as first parameter checkbox:

  6. Now click OK, and then OK again.
  7. Preview the form and test how it works. Since I added the event handler to the change event of the Main Phone field, I’ll do my testing on that one: I’m scolded if I don’t enter a 10-character phone number, and if I do enter one I’m rewarded with a nice standard phone number format. (as long as you’re talking about US phone numbers, anyway!)
  8. Of course, the payoff is that you can now navigate to any entity and use the same function to provide formatting for any phone number field. After you finish off the account form, go to contacts, then leads, and so on.
  9. And by the way: if you get all the way to step 12 and nothing happens, navigate to the web resource through the customization UI (Settings, Customizations, Customize the System, Web Resources) and publish the library of functions. I’ve had intermittent success with the shortcut approach I took here (where I published in step 6 after doing the “in-place” customization approach.) I believe it should work like that but sometimes it seems like it … doesn’t… quite. Anyway, that’s what betas are for.
  10. …and in conclusion…

  11. I meant to record a demo of this so you could get a feel for how much time this can save you. But I ran out of time: my wife told me all she wants for Christmas is a one-second needle and I’m afraid Walgreens will already have run out! I hope you got your shopping done. Merry Christmas and season’s greetings to you & yours – I’ve got to go look for a one-second needle.

Useful Form Scripts, CRM 2011 Style

Useful Form Scripts, CRM 2011 Style

The style of JScript we need to write for Dynamics CRM 2011 has changed significantly in the upgrade from CRM 4.0. If you learn best from examples, here are a few you may find helpful. If you’re just starting out and need to figure out some of the basic stuff like how you add functions to function libraries, and how you add a function library to form properties, here’s an intro article I wrote on the topic.
This article is in more of a summary style — let me know what you think of the format.
Function ShowAccountTabs()
Illustrates hiding and showing tabs , based on selected value of option set
- Contained in function library added to Account form
- Requires two custom tabs, named “customer” and “competitor”
- Tab labels can be anything you want
- function added as event handler for the system option set, customertypecode, (default label Relationship Type)
Function Listing:
function ShowAccountTabs() {
   if (Xrm.Page.getAttribute("customertypecode").getValue() != null ) {
var RelationshipType = Xrm.Page.getAttribute("customertypecode").getSelectedOption().text;
if (RelationshipType == "Customer") {
         Xrm.Page.ui.tabs.get("customer").setVisible(true);
         Xrm.Page.ui.tabs.get("competitor").setVisible(false);
      }     
      else if (RelationshipType == "Competitor") {
         Xrm.Page.ui.tabs.get("customer").setVisible(false);
         Xrm.Page.ui.tabs.get("competitor").setVisible(true);
      }
      else {
         Xrm.Page.ui.tabs.get("customer").setVisible(false);
         Xrm.Page.ui.tabs.get("competitor").setVisible(false);
      }
   }
}
Function CreateOpportunityURL()
Creates a clickable link (URL) for an opportunity record. Useful to include in a workflow-generated email. (Remember: if they aren’t using the Outlook client, the “Regarding” field won’t be clickable.
- Contained in function library added as handler to Opportunity form
- Added as event handler to OnSave event
- Requires custom field for URL, prefix_url
- Current code requires record to be saved once so that GUID exists
Function listing:
function CreateOpportunityURL()
{
   var opportunityid = Xrm.Page.data.entity.getId();
if (opportunityid!= null) {
      if (Xrm.Page.getAttribute("rgk_url").getValue() == null)
      {
         var serverurl = Xrm.Page.context.getServerUrl();
         var recordurl = serverurl+"main.aspx?etn=opportunity&id=";
         var strtemp = opportunityid.replace("{", "%7b");
         var strtemp = strtemp.replace("}", "%7d");
         recordurl += strtemp;
         recordurl += "&pagetype=entityrecord";
         Xrm.Page.getAttribute("rgk_url").setValue(recordurl) ;
      }
   }
}
Function DisplayWebSiteinIFrame()
- Contained in function library added to Account form
- Event handler for custom option set, <prefix>_website, with two values, “SharePoint” and “Bing Maps”
- Depending on which is selected, updates IFRAME_selectedwebsite with dynamically created URL
- For SharePoint search URL, replace “https://sp.magenium.com” with your organization’s SharePoint site
Function listing:
function DisplayWebSiteInIFrame()
{
 if (Xrm.Page.getAttribute("rgk_website").getSelectedOption().text != null) {
var selectedwebsite = Xrm.Page.getAttribute("rgk_website").getSelectedOption().text;
var IFrame = Xrm.Page.ui.controls.get("IFRAME_selectedwebsite");
var Address = Xrm.Page.getAttribute("address1_line1").getValue();
   Address = Address + " " + Xrm.Page.getAttribute("address1_city").getValue();
   Address = Address + " " + Xrm.Page.getAttribute("address1_stateorprovince").getValue();    
switch(selectedwebsite)
   {
      case "SharePoint" :
         IFrame.setSrc("https://sp.magenium.com/search/Pages/Results.aspx?k=" + Xrm.Page.getAttribute("name").getValue() );
         break;
case "Bing Maps" :
         IFrame.setSrc("http://www.bing.com/maps/?q=" + Address);
         break;
   }
 }
}

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Free Samples By Mail