Sunday, August 29, 2010

MS CRM Autofilter gotcha

I am building a report using SSRS that I intend to use as an auto-filtered report inside of MS CRM (see http://blogs.msdn.com/b/crm/archive/2009/03/06/microsoft-dynamics-crm-pre-filtering-tips.aspx). The report pulls data from several views. Everything seemed to be working fine in development until I imported the report into CRM, then parts of the query seemed to stop working.

If you read the end of that article, it points out that all the entities referenced in the FROM or JOIN clauses will have a default filter applied to them that will limit what is included in the query to only records that were modified in the last 30 days.

In my case, I was using a parent entity with 4 outer joins, and I was only retrieving some of the data because some of the related tables had data that was not modified recently.

My solution to this problem was to create a single report that uses only one view with the CRMAF alias, and it used a sub-report that did not have the CRMAF alias on the views. This permitted me to associate the parent report with the entity, and pass the ID’s to the sub-report where there was no filtering.

In my case, I was creating a custom invoice for a custom invoice entity, so I created my parent report with just the one filtered view and gave it an alias of CRMAF_custominvoice. I embedded the sub-report in a table (tablix for VS 2008) control detail band, and gave the sub-report the ID value to pass as a parameter. In the sub-report, I had the rich and complex SQL that I wanted using filtered views, but not using the CRMAF alias.

Tuesday, August 10, 2010

Brokered Deposits - FDIC is wrong

I recently learned that the FDIC is working on implementing rules to limit (or prevent) brokered deposits at banks, ostensibly to prevent banks from being victimized by nefarious deals. Once again the government is doing its level best to show they are doing something even if it is wrong.

For those of you that do not know what a brokered deposit is, here is a link that explains it nicely:http://www.epfc.com/issuing_cd/faqs.html

In this case, our legislature has put too much power in the hands of the FDIC and they are going in the wrong direction. Rather than making the banks act responsibly and put rules into place that would hold individuals responsible for not doing their fiduciary due diligence, they are just about to regulate an entire sector of business (brokers) out of existence. Does this make sense?

If this rule is implemented, it will still be OK for you to buy a CD from a bank in bad financial condition, as long as you buy it directly. Think of it like buying a used car; are you in any better position if you buy it from an individual instead of using a dealer?

I would rather see the FDIC do their job and monitor banks that are in bad condition and make that information available to anyone. When a bank is in bad condition, cut them off so that they do not create a Ponsi-scheme-like situation. And if they do continue to transact bad deals, hold someone accountable and kick him out of the business or throw him in jail.

The more government regulation you create, the more people will rely on the goverment to keep them safe. People will have expectations that all investments are safe because the government said so. If the goverment keeps its nose out, then it would be up to the buyers and sellers to do their due diligence and act responsibly.

Take this story about traffic lights for example from John Stossel . The summary is that when you remove traffic lights, the drivers of cars expect that each intersection is a dangerous place and they will proceed through it more cautiously. As it turns out, accidents decrease to nearly zero and there are fewer traffic jams because cars rarely need to stop. Additionally, pollution in those areas have dropped significantly.

If you have a bank that has too many accidents, then take away their license and get them off the financial road.