This is a good news /bad news story. I have a form that is heavily modified and has 1k lines of JavaScript (JS) code behind it. The good news is that it has a bunch of functionality that really makes the system sing - the bad news is that when you put code behind each field's OnChange event using form customization, then those fields are no longer usuable for bulk edit. This functionality is by design because CRM cannot execute your JS code for each record during a bulk update. In my situation however, I don't care; I still wanted both the customization and bulk edit.
My solution is to override the OnChange events without using the form customization UI. When my form loads, I import & execute a stand-alone JS file (in the forms OnLoad event) that contains functions that define OnChange events for fields. for example:
crmForm.all.new_investor.OnChange = function(){
alert("got here");
}
This code will execute when I change the investor field, but will not prevent the bulk edit from working.
Wednesday, October 6, 2010
Sunday, September 19, 2010
Quickbooks XML List ID relationships to Exported IIF refnum
I have a client that has been using exported customer lists in IIF format for a while in order to interface with an external system that creates invoices in IIF format.
As we are getting ready to move them into MS CRM with a QB link solution from Inogic, we discovered that the Inogic system uses the QuickBooks XML interface which exposes the internal ListID of the customer, and not the QB "refnum" used by their other system (via IIF file).
So the problem was that the old external system had a mass of data that used the QB Refnum field (from customer IIF file), but there was no way to correlate that with the XML version of the QB interface so that we could convert their data to the Inogic data. after a bit of playing with numbers, we discovered that the XML ListID's of the customers had a pattern and found that the first half of the ListID (before the hyphen) was really an encoded version of the Refnum.
To decode it, we used the following procedure:
1. Take the ListID and break it into 2 parts from either side of the hyphen and call them Part1 and Part2.
2. If Part1 is less than 7 characters, pad the left with zeros until it is 7 characters.
3. If the right 4 characters of Part1 ends with 0000, 0001,0002, or 0003 then get the first three characters from Part1 and convert them from Hex to decimal - that is the Refnum
4. If the first character in Part1 is "8", then use the last 3 characters from Part1 and convert them from Hex to Decimal and that is the Refnum.
Now that we have a Refnum for each customer that matches the ListID on the XML interface, we can convert all the data in the external system to use the correct customer linkage in CRM.
As we are getting ready to move them into MS CRM with a QB link solution from Inogic, we discovered that the Inogic system uses the QuickBooks XML interface which exposes the internal ListID of the customer, and not the QB "refnum" used by their other system (via IIF file).
So the problem was that the old external system had a mass of data that used the QB Refnum field (from customer IIF file), but there was no way to correlate that with the XML version of the QB interface so that we could convert their data to the Inogic data. after a bit of playing with numbers, we discovered that the XML ListID's of the customers had a pattern and found that the first half of the ListID (before the hyphen) was really an encoded version of the Refnum.
To decode it, we used the following procedure:
1. Take the ListID and break it into 2 parts from either side of the hyphen and call them Part1 and Part2.
2. If Part1 is less than 7 characters, pad the left with zeros until it is 7 characters.
3. If the right 4 characters of Part1 ends with 0000, 0001,0002, or 0003 then get the first three characters from Part1 and convert them from Hex to decimal - that is the Refnum
4. If the first character in Part1 is "8", then use the last 3 characters from Part1 and convert them from Hex to Decimal and that is the Refnum.
Now that we have a Refnum for each customer that matches the ListID on the XML interface, we can convert all the data in the external system to use the correct customer linkage in CRM.
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.
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.
Labels:
CRM,
ms crm customization,
SSRS
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.
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.
Saturday, July 17, 2010
Open custom entity windows using ETN instead of ETC
I am connecting an Adobe Flex application to MS CRM and one of the tasks we need to do is open a CRM window of a custom entity. If you look at the URL of the custom entity, it contains a parameter that says "etc=1000x" where the number is a reference to the custom entity edit form. If you are developing on the production system (not a good idea) that number is safe to use. However, if you develop on a different system, there is a good chance that the "etc" number will be different.
I recommend that you use the "etn=new_customentity" parameter instead of the "etc=" because the name of the custom entity will always be the same between the development and production systems. The value for etn will be the custom entity name which you will find on the entity customization form.
Helpful tip: if you want to see the full URL of a crm form, press F11 to make the browser full size, then move your mouse to the top of the window and the URL bar will appear - then you can copy the URL and paste it into an editor for your inspection.
Please let me know if this helps and leave a comment.
Thanks!
I recommend that you use the "etn=new_customentity" parameter instead of the "etc=" because the name of the custom entity will always be the same between the development and production systems. The value for etn will be the custom entity name which you will find on the entity customization form.
Helpful tip: if you want to see the full URL of a crm form, press F11 to make the browser full size, then move your mouse to the top of the window and the URL bar will appear - then you can copy the URL and paste it into an editor for your inspection.
Please let me know if this helps and leave a comment.
Thanks!
Wednesday, June 9, 2010
Flex XML - easy to use!
Today I am working on a project that uses an Adobe Flex application to call a .NET back end web service to call some SSRS reports. For one reason or another, I needed to pass an XML string from the front end app to the back end, and found it was incredibly simple. In one of my Actionscript files of my app, I created an XML type variable and added the parameters for the report. The code looked like this:
As you can see, you dont even need quotes around the XML tags, you can do free-form mixing of the tags with the Actionscript code. The variables appear in the curly braces {}. The method called toXMLString() converts all this into a string that looks like this:
The really exciting part is that the XML object managed the containing <reportParameters> tags so I didnt have to worry about closing it properly.
I really like this because now I do not have to write a lot of tedious code with all the open and closing quotes around each literal string and concatenating them together. I hope someone finds this useful.
I hate writing code where I have to carefully manage all beginning and ending
var rp:XML = <reportParameters/>;
var service:CrmService = new CrmService();
service.addgetAllCustomersEventListener(customerResult);
service.addEventListener(FaultEvent.FAULT,serviceFaultHandler);
var custreq:GetAllCustomers_request = new GetAllCustomers_request ;
rp.appendChild(<start>{startdt.text}</start>);
rp.appendChild(<end>{enddt.text}</end>);
custreq.reportParameters = rp.toXMLString();
service.getAllCustomers_request_var = custreq;
service.getAllCustomers_send();
As you can see, you dont even need quotes around the XML tags, you can do free-form mixing of the tags with the Actionscript code. The variables appear in the curly braces {}. The method called toXMLString() converts all this into a string that looks like this:
<reportParameters><start>1/12/2010</start><end>3/14/2010</end></reportParameters>
The really exciting part is that the XML object managed the containing <reportParameters> tags so I didnt have to worry about closing it properly.
I really like this because now I do not have to write a lot of tedious code with all the open and closing quotes around each literal string and concatenating them together. I hope someone finds this useful.
I hate writing code where I have to carefully manage all beginning and ending
Friday, March 12, 2010
I watched in horror last night as Anderson Cooper hosted Mike Moore pontificating his socialistic, feel-good agenda without any balanced point of view. He is a film maker that gets people to listen to him by demonizing some stereotypes. Shouldn't AC, as a journalist, be asking Moore some hard questions instead of just giving him a podium so that he can rant?
Fundamental economics has proven that if a business is making a profit, then more competition will spring up and squeeze the profit margins so that everyone benefits. And the key to making that work is when individual people are making choices about what is best for them. By having the insurance companies bypass the individual and work directly with providers, we lose the efficiencies of a working market. And contrary to Mr. Moore’s claims, as reported by CNN (http://www.cnn.com/2009/POLITICS/07/06/canadian.health.care.system/index.html), government healthcare in Canada is not only incapable of providing a service as good as , people are dying to get service.
When Pres. Obama was campaigning for office, I liked that he espoused a belief that individuals were the solution to our problems, but so far the majority of politicians in DC have completely ignored the individual as a solution, and have been focused on building new institutions that they can control.
Yes, the US healthcare system does need to be changed, but we need more people to take responsibility for taking better care of themselves, and becoming smarter consumers.
Subscribe to:
Posts (Atom)