Tags: , , , | Posted by Yannis Sovolakis on 8/19/2011 9:51 AM | Comments (0)

Accessing external lists using PowerForms is now available (v.2.4).

In the following example we will

  • Define 2 external content types
  • Register PowerForms to design forms
  • Create a lookup control on the foreign key column

We will keep the example as simple as possible here.

We will create 2 tables inside a SQL Server database :

Customers and Countries where the Customers table will have a FK column to the Countries table.

Here is the table definition :

We use SharePoint Designer 2010 to create the appropriate External Content Types (this is not covered by this post).

and for the Countries table :

After setting permissions using Central Admin, we can view the table contents inside our SharePoint environment :

After registering PowerForms for the Customers list, and opening an existing record, we will notice that the COUNTRY_ID and INACTIVE fields are rendered as NumberTextBoxes.

Since the purpose of the INACTIVE column  is to store boolean values (0 or 1) we will change the control type of that control to "CheckBox".

Then we open the properties of the COUNTRY control:

We first change the control type to "ComboBox" since we want to load data from the Countries list.

Then in the Lookup Details tab, we define the lookup parameters (URL, List, Display Field, Value Field).

Notice that we use COUNTRY_ID for the Value Field.

Normally PowerForms use the "ID;#TITLE" pattern of SharePoint to send control values for persistence.

In our case we only want to save the ID of the selected record in our ComboBox.

So in the Advanced tab, open the ExtraConfiguration property editor and select the "SaveValueFieldOnly" checkbox.

This forces PowerForms to only send the ID when sending record data.

We then save the form design and we have a form like the following :

In a more complex scenario, you could combine External Lists with SharePoint lists and vice versa.

Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading