Complex formatting for BCS TypeDescriptor with complex type

I was playing around with specifying ComplexFormatting and FormatString for my BCS model entities. Here are the lessons learnt:

  1. The ComplexFormatting property must be specified at the parent TypeDescriptor containing the complex type, not at the complex type TypeDescriptor itself. So for the model below, the ComplexFormatting property must be specified for the Staff TypeDescriptor, not Address.

  2. The ComplexFormatting property seems to have effect as long as it is specified, regardless of its value. This link http://msdn.microsoft.com/en-us/library/ff464405.aspx shows that the type of this property is Boolean. Most entries on the web however show that this property can be of type String, and can have an empty value. I have tested both, and they both work. Furthermore, setting the type to Boolean and specifying a value of false does not disable complex formatting.
  3. The FormatString property must be specified on the complex type TypeDescriptor. In the screenshot above, it needs to be specified on Address.
  4. I could not get complex formatting to work with SP external lists. I can only get the formatted value in custom code when calling entityInstance.GetFormatted(“Address”).

This article on MSDN gives an overview of the various options for dealing with complex type in BCS and pros/cons of each: http://207.46.16.248/en-us/library/ff798441.aspx.

Advertisements

About Bernado

Based in Australia, I am a freelance SharePoint and Dynamics CRM developer. I love developing innovative solutions that address business and everyday problems. Feel free to contact me if you think I can help you with your SharePoint or CRM implementation.
This entry was posted in BCS, SharePoint 2010. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s