Bind data to a package

Advanced

Example. Bind demo records as well as connected records of other section to the Books custom section.

Demo records:

  • David Flanagan, JavaScript: The Definitive Guide: Activate Your Web Pages, ISBN 978-0596805524, Apress, $33.89.
  • Andrew Troelsen, Pro C# 7: With .NET and .NET Core, ISBN 978-1484230176, Apress, $56.99.

1. Create a section 

For this example, create the Books section in the Section Wizard. Take the section fields from the table below.

The columns and their properties on the section record page
Title
Code
Data type
Required
Name
UsrName
String
Yes
ISBN
UsrISBN
String
 
Author
UsrAuthor
Contact lookup
Yes
Publisher
UsrPublisher
Account lookup
Yes
Price
UsrPrice
Decimal
 

Learn more about how to create a section: Section.

2. Add demo records to the section 

To add records to the Books section list:

  1. Add a record to the Contacts section and enter "David Flanagan" in the Full name field.
  2. Add a record to the Contacts section and enter "Andrew Troelsen" in the Full name field.
  3. Add a record to the Accounts section and enter "Apress" in the Name field.
  4. Add the JavaScript: The Definitive Guide: Activate Your Web Pages book:
    1. Go to the Books section.
    2. Click New.
    3. Fill out the fields of the book mini page:
      • Enter "JavaScript: The Definitive Guide: Activate Your Web Pages" in the Name field.
      • Enter "978-0596805524" in the ISBN field.
      • Select "David Flanagan" in the Author field.
      • Select "Apress" in the Publisher field.
      • Enter "33.89" in the Price field.
  5. Add the Pro C# 7: With .NET and .NET Core book in a similar way.

The Books section list must look like on the figure below.

3. Bind data to the package 

Since the Books section records are connected to the Contacts section records by the UsrAuthor column, bind the author data to the package first.

To bind data to the package:

  1. Bind the contacts:
    1. Go to the Configuration section and select a custom package.
    2. Click Add on the workspace toolbar and select the Data configuration type.
    3. Fill out the properties of the data binding page:
      1. Enter "ContactsInBooks" in the Name property.
      2. Select "Contact" in the Object property.
      3. Select "Installation" in the Installation type property.
      4. Select the records with "David Flanagan" and "Andrew Troelsen" values in the Full name field on the Bound data tab.
      5. Save the data.
  2. Bind the account:
    1. Go to the Configuration section and select a custom package.
    2. Click Add on the workspace toolbar and select the Data configuration type.
    3. Fill out the properties of the data binding page:
      1. Enter "AccountsInBooks" in the Name property.
      2. Enter "Account" in the Object property.
      3. Select "Installation" in the Installation type property.
      4. Select the record with the "Apress" value in the Name field on the Bound data tab.
      5. Save the data.
  3. Bind the books:
    1. Go to the Configuration section and select a custom package.
    2. Click Add on the workspace toolbar and select the Data configuration type.
    3. Fill out the properties of the data binding page:
      1. Enter "Books" in the Name property.
      2. Select "UsrBooks" in the Object property.
      3. Select "Installation" in the Installation type property.
      4. Select the records with the "JavaScript: The Definitive Guide: Activate Your Web Pages" and "Pro C# 7: With .NET and .NET Core" values in the Name field on the Bound data tab.
      5. Save the data.

4. Check the data bindings 

As a result, Creatio will bind the data of the Books, Contacts, and Accounts" sections to the custom package.

You can transfer the package between environments using the package export and import mechanism in Creatio IDE. After you install the package into another environment, the bound records will be displayed in the corresponding sections.