30. May 2010 20:39
by Chaks
19 Comments
Associations in BCS are a great way to relate two external content types based on a foreign key. It is actually very easy to create an association using SharePoint Designer 2010 – no code required!
You can read more on the following blogs posts to know more about associations:
1) The Notion of Associations and the External Item Picker
2) Tooling Associations in SharePoint Designer 2010
If you want to know quickly how can Associations help me, consider the picture below:
The Sales Order table has a column CustomerID which is actually a foreign key in the Customers table.
If you create Sales Order external list, you will notice that you get a text field for entering the CustomerID, which isn’t that helpful:
But if you create an association, then you get an external item picker where you can filter/select the customer:
If you read the blog post which I pointed out earlier, it says:
“……it’s possible to show a friendly display name on the external item picker control upon customer selection to show something more meaningful that the number that identifies the customer in the external system, for instance the customer name, or whatever field that is tagged as the title field in SPD.”
But how do you ‘tag as the title field in SPD’ ?
Well, it turns out it is very easy and simple!
Set Field as Title
In your external content type Summary View, select the field you want to ‘tag as the title’:
In the Ribbon, select Set as Title:
Now, you will be able to see that field, whatever is set as Title in the external item picker instead of the default identifier field