So which is it?

On September 7, 2006, in Meanderings, by Mitch Milam

I really wonder about companies sometimes. Take a look at some of the SPAM I received this morning:

So in a period of less than an hour, I went from having the opportunity of receiving Unlimited Virtual Seminars to merely getting 20% off.

Hmmm….

 

Using Filtered Views with CRM 3.0

On September 7, 2006, in Dynamics CRM, Reporting, by Mitch Milam

Some of my customers use Microsoft Excel or Access to pull data from the CRM system in order to produce custom reports, or in one instance, to interface with a third-party bulk-email application.

CRM 3.0 has a set of SQL Database Views, called Filtered Views, that are constructed in such a way that CRM Security roles are maintained and you can retrieve nothing using one of these views that you would not ordinarily see while using the CRM application.

One aspect of using filtered views that you must take into consideration is the fact that all data ( that you have access to ) will be retrieved from the specified Entity.  This means both Inactive and Active records.

If you don't take Inactive records into consideration your result set could be drastically different than what you expected and  you may inadvertently expend resources on inactive customers.

Luckily, CRM provides two data fields that can be used to filter your query:

SQL Column Value
statuscode 1 = Active 

2 = Inactive

statuscodename Active 

or

Inactive

 

 

 

 

 

 

 

 

 

So, here is how you would use the above:

 

--
-- Show only active Accounts
--
select * from FilteredAccount where statuscode = 1
 
--
-- Show only active Contacts
--
select * from FilteredContact where statuscode = 1
 

This code instructs SQL Server to return all rows where the statuscode is equal to 1, which is an Active Account or Contact.

 

New Dynamics CRM Poll added

On September 6, 2006, in Dynamics CRM, by Mitch Milam

Since most of my work these days revolves around Microsoft Dynamics CRM 3.0, I would like to know what CRM feature interests you the most.

If you look at the bottom of the right-hand sidebar on my blog, you'll find a poll where you can vote on topics that are important to you.

If you find a topic of interest isn't listed, just email me:

mitch at infinite-x dot net

I would like to use this information to provide more focused information to my audience.

Thanks, Mitch

 

Test post #2 with Windows Live Writer

On September 6, 2006, in Dynamics CRM, Misc, by Mitch Milam

Wow! Test number one worked great. I'm rather impressed.

Not only does it publish my article directly to my blog engine, when it performed the initial connection to my blog, it also downloaded all of my categories so that I can apply a category to the article like I normally would if I were creating the article through my blog's web interface.

Let's try that code syntax plug-in again, but this time, let's use some JavaScript code from an article published back at the Spring:

/* Specify the currency symbol for your part of the world*/
var sCurrencySymbol = "($)";
/*
CRM tab IDs are numbered tabx - taby, from 0 to the number of tabs-1.
For each tab that you would like to alter, insert its ID into the array
myarray.
For example, if you only wanted to alter the field labels on the General Tab
your code would be:
     var myarray = new Array('tab0');
*/
var myarray = new Array('tab0', 'tab1');
for (var loop in myarray)
{
/* get a hande to the tab containing our form fields */
var tabs = document.getElementById(myarray[loop]);
/* locate all of the HTML Table structures on the Tab */
var tables = tabs.getElementsByTagName("table");
/* loop through all of the Tables on the Tab */
for (var i = 0; i < tables.length ; i++)
{
/* Locate all of the table Cells within the specified Table */
var td1 = tables[i].getElementsByTagName("TD");
/* loop through all of the Cells in the Table */
for (var i2 = 0; i2 < td1.length ; i2++)
{
     var sElem = td1[i2];
     /* So we're looking for Cells that have a Class of n (for number)
         If we find that class, we look to see if the text within the Cell
         contains our currency symbol. If it does, we delete it by replacing
         it with a blank string.
     */
     if ((sElem.getAttribute('className') == "n") &&
         (sElem.innerHTML.indexOf(sCurrencySymbol) > 0))
                 sElem.innerHTML = sElem.innerHTML.replace(sCurrencySymbol, "");
}
}
}

Looks pretty cool. And having things color-coded makes reading the code much, much easier.

Conclusion:

Windows Live Writer has made quite the first impression on me.  The user interface is very intuitive. It has useful features like Spell Check and the code it publishes doesn't need to be modified once it arrives on my site.

I'll need to play with it for a while but unless things change a whole lot, I may have found myself a new blog publishing tool.

 

Test post using Windows Live Writer

On September 6, 2006, in Misc, by Mitch Milam

I was catching up on my blog reading this morning and ran across a new blog I had subscribed to from Alex Barnett.  He was mentioning a new set of plugins had been released for Windows Live Writer.

So I'm thinking, "Hmm. Windows Live Writer. What the heck is that."  It is basically a Windows application that allows you to compose and publish weblog entries from your workstation.  And rather than create a totally Windows Live-centric package, they actually included support for other blog engines, like WordPress, the one I use.

So, I thought I'd see what would happen if I used Live Writer to publish a test article.

Here is a test of one of the plug-ins mentioned above. It will automatically insert properly highlighted colored programming code:

 

//
//
//
FileStream liveStream = new FileStream(localfilename, FileMode.Open,
                                     FileAccess.Read);
byte[] buffer = new byte[(int)liveStream.Length];
liveStream.Read(buffer, 0, (int)liveStream.Length);
liveStream.Close();
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Length", buffer.Length.ToString());
Response.AddHeader("Content-Disposition", "attachment; filename=" +
                 originalFilename);
Response.BinaryWrite(buffer);
Response.End();
 

An interesting proposal: Vlad’s 2007 Agenda

On September 5, 2006, in Misc, by Mitch Milam

Vlad Mazek wrote a post today that I think that all independent consultants and small consulting shops should review.

Among other things, Vlad is proposing a network of consulting professionals and companies who can work together to leverage each others strengths:

There are literally thousands of people worldwide you can *compete with together*. The advantage is twofold:

  • You can offer the same services you offer locally nationwide or even worldwide
  • You can offer more services locally than you can by yourself
  • You can offer higher end solutions that you may not be able to manage yourself

  

This is an excellent idea. 

 

Why it's a good idea: 

As computer systems get more complex, I think that each of us will end up picking a specialty and learning that specialty inside and out. ( I also worry that the days of the generalist may soon be a memory. )  If we're all specialists, how do we find people who can do the things we can't?

Vlad mentions that in Orlando, where he is located, they have spent a lot of time and money identifying who does what and should a need arise that is outside someone's area of specialty, they know who to call.  I sure wish we had that here in Dallas.

Anyway, I don't think you can put a true value in knowing who to call when you've reached the end of your rope. This makes your life a lot easier and makes the customer much more comfortable knowing that you have resources to assist you, should they be needed.

 

Can it be done? 

And if anyone can make it a reality, I think that Vlad can.  It will be a lot of work, and will require a lot of time and resources. Finally, it will require a lot of participation for the community.

  

Next steps:

Anyway, take a look at his article and think about what he says. 

What them Texas Aggie's refer to as Cogitate.

 

 

Development: Atlas and File Downloads

On September 4, 2006, in Development, by Mitch Milam

I ran into an interesting issue as I was adding the download component for my net site.

Using the sample code from the following article, I was attempting to initiate a file download.

CodeGuru: ASP.NET Tip: Control Access to a File Download

The problem I encountered was my download test harness was inside of an Atlas UpdatePanel and the way the sample code above works, is to inject content into the Web Response to be delivered to the client.

Needless to say, the absolute last thing the UpdatePanel expected to receive was a 250K ZIP file when all the user ( me ) did was to click on a link.

What really irritated me was the fact that I could not tell until very late in the process that it was actually the UpdatePanel causing the problem. Most of the time was spent trying to figure out where to put files so that GoDaddy would actually let me touch them.  More on those issues in a later article.

Anyway, the solution is to simply create a page whose entire existance is to do nothing but download files using a page parameter. Put the actual download code in the code-behind, verify the filename parameter and make sure the user has logged in. The code in the above article does the rest.

One final note, if you are downloading things that can be displayed in a browser, like a JPEG file, the probability is high that the file is not downloaded, but merely displayed in a browser.

 

Development: Interesting issue with Server.MapPath

On September 3, 2006, in Development, by Mitch Milam

I was working on my site transition and developing the download code when I ran into a very interesting issue while using the Development Web Server that is built into Visual Studio 2005.

Consider the following code:

string rootDir = Server.MapPath(@"~\downloads");
string rootDir2 = Server.MapPath(@"..\downloads");

 

If you are running on the development web server, the second command will fail with a message: Failed to map the path.

However, if you deploy and run the same code to a real IIS server, you will receive the following correct values back:

d:\hosting\files\test\downloads
d:\hosting\files\downloads

I am going to make an assumption that this issue is related to the way in which the Development Web Server is actually creating the virtual web server. 

 

 

Web Site Redo. Part 2

On September 1, 2006, in Development, Misc, by Mitch Milam

As I mentioned in an article from last weekend, I'm in the process of moving my company's web site from being FrontPage-based to a full-blown ASP.NET framework.  Today, I thought I'd give you an update on my progress and discuss some of the more interesting aspects of the migration.

User Interface:

Overall, I'm still using the same exact interface for both the FrontPage and ASP.NET versions. However, for the .NET version, I thought I'd try and implement some of the newer technologies that allow me to provide a better user experience.

I'm sure by now that you've heard of AJAX and if you read much on this blog, you've seen me comment on Microsoft's AJAX framework called Atlas.  I decided to utilize Atlas in as much of the site as is practical.  If you've never seen what Atlas or AJAX can do for a web site, take a look:

Point your browser to the home page of the ASP.NET version of my site:
http://test.crmaccelerators.net. You should see something like this:

Once you are there, click on the About Us link at the top of the page.  You should now see the following page:

Notice how the screen flashed as the new page was loaded?

Ok, now click Contact. Then click News.

Disregarding the lack of real content, did you notice you don't see that flash as the entire page reloads?  That's because it isn't. 

The Technology Behind The Page: 

The page shown in the second figure is actually only a single page. I utilize a ASP.NET 2.0 component called a Multiview that allows me to create a single web control containing many child pages ( called a View ). When you click on the navigation links at the top of that page, I'm merely changing one View to another.

Additionally, I wrapped the entire page in the Atlas UpdatePanel component that is set to use Partial Updates. This means we are only going to be refreshing areas of the page that actually change, not the whole page.

Since we don't have that annoying page refresh flash each time the user navigates to new page, it makes for a better user experience.  At least I think it does.

Caveats:

The Atlas framework is still a work in progress so you will, at times, run into issues.  Wednesday night, I decided to upgrade to the latest versions of Atlas with the Atlas July CTP release and Release 60731 of the Atlas Control Toolkit.  This promptly broke my site. Totally.  It took me over an hour to figure out what the problem was and I had to download the latest non-production build of the Toolkit to make the issue go away.  At least Microsoft decided to release the source code for the Toolkit so it makes it a easy process to complete.

ASP.NET 2.0 has Membership and Personalization functionality built into the system. I'm going to be using that with my new site to control access to various site sections and pages. Unfortunately, Atlas and the Membership controls don't play nicely together ( in the current version ) so work arounds needed to be created to make sure everything functioned.

Next Steps:

CRMAccelerators.net is hosted at GoDaddy.com which has presented a variety of issues related to the amount of control that I actually have on the site.  I'll cover those issues in the next installment of this process.

We'll also discuss Membership and the hosted web site environment.