top of page
Search
katiguthridge464pc

Benefits and Challenges of Using a Regular Content Type with an External List Column in SharePoint



Creating an external content type is a pivotal task when you are working with external data. An external content type contains important information about connections, access, methods of operation, columns, filters, and other metadata that is used to retrieve the data from the external data source.




Using a Regular Content Type with an External List Column as part of its properties then Consuming i




Configure Business Data Connectivity Services An administrator must make sure that the user who creates the external content type has permission to the Business Data Connectivity (BDC) metadata store and that appropriate users have access to the external content type on which the external list is based.


Be sure Office 2013 is ready to use To synchronize external data with Office 2013 products, you must use Windows 7 or a later version, and make sure that the Office installation option for Business Connectivity Services (BCS) is enabled (this is the default). This option installs the Business Connectivity Services Client Runtime which does the following: caches and synchronizes with external data, maps business data to external content types, displays the external item picker in Office products, and runs custom solutions inside Office products. You must also have SQL Server Compact 4.0, .NET Framework 4, and WCF Data Services 5.0 for OData V3 on each client computer (If necessary, you are automatically prompted to download the software).


The external item picker control allows users to select a field, such as an ID field or a field that has unique values, to conveniently choose an item. This control is available in SharePoint and Office 2013 products. For example, users can use this control to choose an item from an external list of customers and Word 2013 enables this control for use with content controls that are linked to external data columns.It's a good idea to select the specific columns you want to display in the external item picker control because the default operation is to show all the columns, which in most cases, is not necessary.


If you do not define a filter, an external list returns all of the data up to the Business Connectivity Services (BCS) throttle limit (by default, 2,000 items) or all the data that is defined in the external content type, if less than the current throttle limit. In addition, the entire processing of the results occurs within the SharePoint product. It's a good idea to define at least one filter. In general, there are two types of filters that you need to be aware:


A good strategy to consider is to create a set of external list views based on specific Data Source Filters that make sure that larger amounts of data are filtered first in the external data source, and then users can further filter and refine the results by using SharePoint filters.


Configure Business Data Connectivity Services An administrator must ensure that the user who creates the external content type has permission to the Business Data Connectivity metadata store and that appropriate users have access to the external content type that the external list is based on.


Create an external content type A user must define an external content type which contains information about connections, access, methods of operation, columns, filters, and other metadata used to retrieve the data from the external data source.


Make sure Office products are ready for use To synchronize external data with Office products, you must have Windows 7 or later and the following free software products, SQL Server Compact 4.0, .NET Framework 4, and WCF Data Services 5.0 for OData V3 on each client computer (If necessary, you are automatically prompted to download the software). Also, make sure the Office installation option, Business Connectivity Services is enabled (This is the default). This option installs the Business Connectivity Services Client Runtime which does the following: caches and synchronizes with external data, maps business data to external content types, displays the external item picker in Office products, and runs custom solutions inside Office products.


To create a structured document in Word 2013, you use content controls which enable you fix the position of content, specify the kind of content (text, date, picture, and so on), highlight with color, and control editing. You can also automatically link the content controls to corresponding external data columns.


On the Insert tab, in the Text group, click Quick Parts, point to Document Property, and then click and drag each field based on the external data columns to the body of the document as content controls.


This article describes a scenario in which the AdventureWorks sample database that is hosted in Microsoft SQL Server 2008 is used as an external system. You will create an external content type by using Microsoft SharePoint Designer 2010. Then, you will create a Microsoft Excel 2010 add-in to interact with an external system to read external items, navigate associations, and update external items by using the Business Connectivity Services client object model. The Excel add-in is deployed to the client by using a ClickOnce package. The metadata model will be deployed separately to the client by using a ClickOnce package created with the BCS Solution Packaging Tool.


SharePoint Designer 2010 includes functionality that you can use to design the external content types visually. Based on the options that are selected in the user interface (UI), SharePoint Designer generates XML metadata in the background. By using the ECT Designer in SharePoint Designer, you can discover the database and point to the table, view, or stored procedure that will perform the operations. Then, return the required data and use it to create the external content type, without writing any code or XML. Use the following procedures to create the external content type.


The Office Item Type that is selected determines the Microsoft Outlook behavior that you want to attach to the external content type. The Offline Sync for external list field determines whether lists based on this external content type can be taken offline in Outlook or Microsoft SharePoint Workspace 2010. Accept the default Enabled setting.


To create default operations, click Create All Operations. In the wizard that opens, in Filter Parameters Configuration, define a filter of type Limit with a default value 20 on column SalesOrderId. Because we want to limit the number of records returned, this gets the top 20 rows from the external system.


In Filter Parameters Configuration, define a filter of type Limit with a default value of 100 on the SalesOrderId column to limit the number of records returned. Click Next, and then click Finish to create the operation.


UpdateSalesOrderDetails method: This method is executed when the value in the ComboBox control changes. The logic gets the line items that correspond to the selected SalesOrderHeader external content type by using the Association method. The Sheet1 worksheet in Microsoft Excel is refreshed and SalesOrderLine External Items that are returned are shown for the selected SalesOrderHeader.


UpdateLineItems method: This method is executed when the user selects the option to save the changes in SalesOrder lines by using the Update Discount button on the ribbon. It iterates over changed line items for SalesOrder that are selected in the combo box and runs an Updater method on the SalesOrderLine external content type by using the changed values in the sheet.


CreateSalesOrderHeaderTableStructure creates the structure for the data table used to store External Items for SalesOrderHeader. GetFinderView returns the View definition for the Finder method of the SalesOrderHeader external content type. Fields in the view are used to create the data columns. This is shown in the following code example.


Create an external list on the SharePoint Server computer based on the external content type, and synchronize the list to the client computer by clicking the Sync to SharePoint Workspace button on the ribbon of the external list. This gets the metadata from the server running SharePoint and data from the external system and makes it available in the Business Connectivity Services client cache and Microsoft SharePoint Workspace 2010.


Create a DataSolution for the Excel add-in. By using the BCS Solution PackagingTool, you can create a Microsoft Visual Studio ClickOnce package that contains the BDC model and subscription files for the external content type. When deployed to the client, it reads the client cache subscription rules and imports metadata into the client cache. After it is on the client, this can be used to execute Business Connectivity Services client object model calls to fetch and update data in the external system.


This cache subscription file is used to create the subscription for the SalesOrderHeader external content type with caching enabled. The IsCached property determines whether external content type data is cached on the client, as shown in the following example. You can use the BCS Artifact Generator Tool to create the subscription file based on the BDC model.


In the DataSolutionPackage folder, create a subscription file and name it SalesOrderLineSubscription.xml. (Or, give the file a name that you choose, but the name must end with the string subscription.) This cache subscription file is used to create a subscription for the SalesOrderLine external content type with caching enabled, as shown in the following example.


Populate the ComboBox control to show the SalesOrder numbers by executing the Finder method on the SalesOrderHeader external content type. The text box shows the SubTotal amount for the order that is selcted in the combo box. Sheet1 shows the SalesOrderLine items for the selected SalesOrder in the combo box. You can update the line item UnitPriceDiscount column with any value between 0.00 and 1.00, with 1 indicating 100%. 2ff7e9595c


1 view0 comments

Recent Posts

See All

댓글


bottom of page