Monday, October 14, 2013

Good Links for Entity Framework Code first design and relationsahip association

Just read the next two blogs which are really useful in design domain driven model with EF code first, and worth noting here as reference in my daily dev work life.

This msdn series article discussed how to build a real model in DDD and the pitfalls in a traditional database mapping view.
http://msdn.microsoft.com/en-us/magazine/dn451438.aspx

This blog has clearly explained the relationships in using entity framwork code first.
http://weblogs.asp.net/manavi/archive/tags/C_2300_/default.aspx

Wednesday, October 2, 2013

Using external list to building screens for users to CRUD and adding search filters

When the external content type is created, the filters can be added in the read list operation. If you create a site page and add the Business Data List web part, the filters will be shown automatically for users to be able to search. However, the search functions created are really hard to use. The below article show a step by step guide to build a custom filter screen on top of the list web part, which can be customized and easier to use.

http://arsalkhatri.wordpress.com/2012/01/07/external-list-with-bcs-search-filters-finders/

Also many times users will want to be able to just press enter to be able to search, so I added the key press event for the button as well,

  var body = document.getElementsByTagName('body')[0];
  body.onkeydown = function (e) {
        if (window.event.keyCode === 13) { 
ApplySearchFilters();
        }
  }

And when I tried to add the wild search for a field which is not null in database, do not use Ignore filter if Value is Null. Instead, just check the Custom value radio button, it will work.

For all other fields with nullable fields, Null is fine.