Tuesday, August 5, 2008

It's the little things! JavaScript Extraction Tool

I just saw this post by Joris Kalz on his blog posted Monday, August 04, 2008 5:04 PM and I cannot wait to try it out. There has been many times I wanted a tool like this, plus it will help me document those hidden customizations for my clients. WAY TO GO Joris and thanks.


I recently had to transfer several customizations to a different CRM installation. While Microsoft Dynamics CRM offers an export and import functionality, in this case I just wanted to select specific client side customizations. However, manually grabbing all jscript code is a little bit time consuming. Instead, I wrote a few lines of code to export all jscript code without annoying interaction.VS Project CRM to JS Export

 

The code is pretty straight forward, so feel free to modify. You can download the VS 2008 project here: Microsoft Dynamics CRM Jscript Export Tool

Before you start this tool, you have to change the app.config according to your CRM installation:

WindowClipping

After running the tool, all client side jscript will be stored at the declared output folder.Running-CRM-Jscript-Export-Tool

The result will be a list of all entities containing jscript separated by event type and further by form and field events.

JScript-File-List

Hopefully you like this tool. In the final stage of this tool, it will be even possible to write changes back to Microsoft Dynamics CRM.

Monday, August 4, 2008

Working with Dynamic Entities in CRM 4.0

Mitch Milam's Microsoft Discussions wrote this

Working with Dynamic entities is a bit different in 4.0 vs. 3.0.  When writing plug-ins and using Microsoft.Crm.Sdk, you have the ability to access the attributes of a Dynamic Entity via a property bag, much like this:

DynamicEntity updateEntity = new DynamicEntity("m3_roundrobin"); updateEntity["m3_lastuserid"] = newOwner.ToString(); updateEntity["m3_teamid"] = teamId.ToString();

However, if you're writing an application that used the standard CRM web service, this methodology is not available to you, so you have to resort to the more code-intensive methods we used in CRM 3.0

Fortunately, if you look deep into the CRM SDK, you'll find a solution to this issue.

After installing the CRM 4.0 SDK, browse to this folder:

\sdk\server\helpers\cs\crmhelpers

and look for the following file:

dynamicentitypartialtype.cs

If you add this file to your Visual Studio project, you will have the same Dynamic Entity property bag capability using the CRM web service as you do when using the Microsoft.Crm.Sdk assembly.

I was pleasantly surprised when I located the code and it has made working with Dynamic Entities much easier.

 

Have a great weekend everyone.

Microsoft Dynamics CRM 4.0 Implementation Guide update 4.2.0 is now available!

Matt Peart Published Wednesday, July 30, 2008 9:33 AM

I’m pleased to announce that the second update to the Microsoft Dynamics CRM 4.0 Implementation Guide is now available!

In our commitment to provide continuous publishing to our customers and partners, Microsoft Dynamics CRM 4.0 Implementation Guide update 4.2.0, contains the following:

  • Over 30 corrections and revisions.
  • 3 new topics.
    • Install Microsoft Dynamics CRM Server on multiple computers (using NLB)
    • Deploy Microsoft Dynamics CRM for Outlook with Systems Management Server 2003
    • Configure an Organization Database for SQL Server 2005 Database Mirroring
  • A change summary sheet that describes each correction and addition as well as its relative location in each guide.

To verify that you viewing the latest version, open any of the guide document files, and then on the title page (the first page of the document) in the lower left-hand corner the revision number is displayed. Again, the most current release is 4.2.0.

The change summary sheet is a separate document included in the package. The document file name is v4_2_0_ChangeSummary.doc.

Get the latest version today at www.microsoft.com/downloads/details.aspx?FamilyID=1ceb5e01-de9f-48c0-8ce2-51633ebf4714&DisplayLang=en

Reminder: All new topics are published to the Resource Center before being added to an update to the IG. To view this content and more like it early, visit http://rc.crm.dynamics.com/rc/regcont/en_us/opdefault.aspx?page=settings or click Resource Center in the application and then in the left navigation bar click Settings.

Regards,

Matt Peart

Microsoft Dynamics CRM URLs

Jagan Peri Published Friday, August 01, 2008 8:48 AM

CRM 4.0 introduced many changes to the way URLs need to be constructed.

In MSCRM 3.0 and earlier, you could simply access a page by using a URL such as http://<crmserver:port>/default.aspx

The introduction of multi-tenancy and CRM Online/IFD deployments required changes to the URL formats. Both CRM online and IFD deployments require URLs of the form https://orgname.mycrmhost.com – This was mainly done for reasons related to securing cookie domains, but also helps provide organization specific URLs.

Things are a little bit different for on-premise CRM installations.

a)      we need a way to indicate which organization the user is trying to access – The format used here is: /orgname/page.aspx">/orgname/page.aspx">http://<crmserver:port>/orgname/page.aspx

b)     We actually don’t create virtual directories for every organization. MSCRM implements a virtual path provider that parses the URL to figure out which organization you are accessing and help in performing the correct authentication (verifying that the user is a member of that organization etc).

c)     For on-premise deployments, if a user just types in a URL without an organization name (such as http://crmserver ), MSCRM would try to service the request for the user’s default organization.

One of the common questions is around accessing custom pages and the correct URL format for that.

Rich Dickinson on the CRM PM team compiled an excellent list of when the custom page should be accessed using an org specific URL and the table below is based on that compilation.

URL to access what object?

Format for On-Premise Deployments

Format for IFD deployments

Format for CRM Online

aspx page or webservice under ISV folder using MSCRM’s vdir

Prepend org name to the page – http:<crmserver>/orgname/isv/page.aspx

Do not prepend org name to the page. URLs are of the format:

http://orgname.myhost.com/isv/page.aspx

N/A

aspx page or webservice not under MSCRM’s vdir (on a separate vdir or server for example)

Do not prepend.

Do not prepend

Do not prepend org name.

ISV Menu/Iframe to a URL addressable CRM form

Prepend org name

Do not prepend orgname

Do not prepend orgname

Access crmservice.asmx

Use DiscoveryService

Use DiscoveryService

Use DiscoveryService

You will notice that you will have to prepend the orgname to the URL if your page is under the ISV folder in MSCRM’s vdir (for on-premise deployments). This is because the MSCRM virtual path provider will process the request to your page and it will assume the request is for the default organization for that user if an orgname is not specified and can result in “The organization id of the user being verified does not match the organization id of the execution context passed to VerifyUser” error.

'Michael Höhne' has a more detailed blog explaining the authentication issue at: http://www.stunnware.com/crm2/topic.aspx?id=js28

Important note: We will soon be documenting an API (prependOrgName) that can be used in client side scripts to adjust a given URL automatically. We’ll have a blog announcing this in the CRM team blog as soon as the documentation is ready (next round of SDK documentation update will be around end of august).

The CRM SDK documentation also has walkthroughs on how to use discovery service to get the URL to access MSCRM webservices -- http://msdn.microsoft.com/en-us/library/bb955359.aspx

Jagan Peri

Setting up a “mirror” of a production environment for dev/testing

mscrmguy wrote this on Thursday, July 31, 2008

I recently needed to set up a “mirror” of a production system for use in development and testing. I had worked with the Redeployment tool in CRM v3 and I was interested to see how v4 worked. I was very happy when the v4 tool was *very* easy to use, and here are the steps I followed.

1. Used SQL 2005 to do a backup of the CRM v4 production databases
2. Using the VPC image distributed by Microsoft, I copied the .bak file to the VPC. I then did a restore of the database files to the VPC SQL instance. For some reason the SQL GUI did not work, so I used the following command (Names changed):
restore database OrgName_MSCRM from disk='C:\Temp\OrgName_MSCRM.bak' WITH MOVE 'OrgName_MSCRM' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ OrgName _MSCRM.mdf', MOVE ' OrgName _MSCRM_log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\ OrgName _MSCRM_log.LDF'

3. Once the DB was successfully restored on the VPC image, I fired up the CRM Deployment Manager, right-clicked on the “Organizations” item, and selected “Import Organization”
4. The next step asked me to specify the SQL server, and as soon as I did that the deployment manager found the organization I wanted to import
5. The next screen asked me for a name and a display name
6. Next input was the report server URL
7. The next steps involved the mapping of users. There are several options for this tep, I chose to simply “Manually Map Users”, and the only user I mapped was the Administrator which was mapped to the Litwareinc Administrator on the VPC. I got a warning that “All users are not mapped. Do you wish to continue?” and just clicked “Yes”
8. The next screen was simply the tasks verification screen, so I clicked “Next” and then on the next screen “Import”
9. And that was it! It took a bit of time and at the end I am able to access the org via http://moss:5555/orgname/loader.aspx

You can see the screens here but please note names are hidden:

http://www.mscrmguy.com/redeploy/redeploy.html

Moving from CRM Online to CRM Onpremise

This whitepaper lists the steps needed to migrate from a Microsoft CRM Online deployment to a Microsoft Dynamics CRM 4.0 on-premise deployment. This process will move all the CRM data as well as the customizations and configurations to an Onpremise deployment.

Microsoft CRM Online Data Migration to Microsoft Dynamics CRM 4.0 On-Premise

Reporting Server will not work after upgrade.

This article Posted by Matt Wittemann seems to cover an issue that we are having.


The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.
Posted by Matt Wittemann

In a recent upgrade environment, now running CRM 4.0, I found that reports stopped working from CRM. What was strange was that reports could still be run from the SQL Reporting Services website, just not from CRM - not even on the CRM server, so I knew it wasn't just a Kerberos authentication problem (and SQL was on the same box with CRM anyway!). After checking and re-checking all the settings in the SSRS website, the registry hive for CRM, and everywhere else I could think of, I opened a support ticket with Microsoft.

But whenever I have to ask for outside help, I feel like I need to re-double my efforts in locating the problem and fixing it myself. (I should probably just open tickets all the time!). After much searching, I found an obscure reference on a SQL forum about this error (The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.) and a mention of an update for SQL 2005. I logged onto the SQL server and ran Windows Update, and there it was - KB948109. Downloading this update and installing it fixed the problem. After the update, there was an error in the event log indicating that the .NET Framework 2.0 could not recompile, but upon running a report and waiting a long time for the app to compile, reports started working again throughout the network. Yay!

Here's a link to the update for more information:
http://support.microsoft.com/kb/948109