This post originated from an RSS feed registered with .NET Buzz
by Anand M.
Original Post: MS CRM ListView Webpart Bug??
Feed Title: .NET From India
Feed URL: http://www.dotnetindia.com/index.rss
Feed Description: Your daily dose of .NET From India
If you are using Microsoft CRM 3.0, it ships with a set of webparts that allow you to integrate CRM data with SharePoint called the CRM ListView webparts. You can put a set of these webparts in a MOSS page and then link them via a producer-consumer setting to filter data.
A colleague of mine was working with these and suddenly the filtering part started working and the webpart stopped posting back when choosing a row. The webparts are supposed to postback so that the other webparts will filter if it is setup as a provider. It was not clear, when this problem occurs and it seems to be very randon and seems to go away when he plays around with the page.
After some debugging of the scripts and the page itself, I found that the webparts generate dynamic js to handle the clicks and postback to initiate the filtering. When you click on a webpart it calls a javascript function called CRMHandleSingleClick and that in turn bubbles down to a javascript that seems to have been dynamically generated to handle the row's single click. This function seems to have a variable ProducerOrConsumer, the setting of which decides if the postback occurs.
What I found after a initial poking around I found that if the last webpart in the page is not filtered, then it sets this variable to false and this seems to affect all the other webparts above. So if the last webpart (rendering wise) is not filtered, then none of the webparts seem to acknowledge the filter setting as this variable seems to be false and they do not post back.
If all webparts in a page are either a producer/consumer or the last webpart in the page is one, then this problem seems to disappear.
Ok, this variable may not be the exact problem, as I just sent an hour or so with this. But setting all controls to be a part of a filter or making sure that the last control has this setting, seem to solve this problem.
Helpful to know this, if you are also having similar problems.