Solution: How to map External Content Type to Office Item Type (Outlook) without using SharePoint Designer

Hi,

Several months ago I stumbled into an issue. I had OData data source with events and had to connect it to Outlook. Usually, it is a very simple task to map a content type to Office Item Type using SPD. However, for a while, SPD can’t work with OData at all. So, it was impossible to use common tool for that.

After three days of unsuccessful googling and asking how to achieve it everywhere 🙂 I tried to investigate it myself and found a way to do it!

It appeared that it is quite easy to map it by hand. For that you have to make 2 changes in the BDC model file (xml with a .bdcm extension):

Add property with the name of Office item type to the entity

 <Entities>
  <Entity Name="AbsenceCalendar" DefaultDisplayName="AbsenceCalendar"  Namespace="MyNameSpace" Version="1.0.0.0" EstimatedInstanceCount="2000">
    <Properties>
      <Property Name="OutlookItemType" Type="System.String">Appointment</Property>        
...
    </Properties>    
...

 Map necessary fields to the Office Item Type. For instance, for the mandatory fields of the Appointment Office Item Type it could look as follows

<Method Name="ReadSpecificAbsenceCalendarEntity" DefaultDisplayName="Read Specific AbsenceCalendarEntity" IsStatic="false">        
......          
  <Parameter Name="@AbsenceCalendarEntity" Direction="Return">         
      <TypeDescriptor Name="AbsenceCalendarEntity" DefaultDisplayName="AbsenceCalendarEntity" TypeName="Microsoft.BusinessData.Runtime.DynamicType">
      <TypeDescriptors>
         <TypeDescriptor Name="Title" DefaultDisplayName="Title" TypeName="System.String">               
         <Properties>
          <Property Name="OfficeProperty" Type="System.String">Subject</Property>     
         </Properties>               
        </TypeDescriptor>               
        <TypeDescriptor Name="StartDate" DefaultDisplayName="StartDate" TypeName="System.DateTime">                  
          <Properties>                     
           <Property Name="OfficeProperty" Type="System.String">Start</Property>                  
          </Properties>
        </TypeDescriptor>                
        <TypeDescriptor Name="EndDate" DefaultDisplayName="EndDate" TypeName="System.DateTime">                    
          <Properties>                          
            <Property Name="OfficeProperty" Type="System.String">End</Property>                    
         </Properties>
     </TypeDescriptor>    
.......

Hope it helps somebody else.

Leave a Reply

Your email address will not be published. Required fields are marked *