Select box - database attribute dependency

If you have added multiple Select box - Database attributes to your template, you can add a dependency between the attributes.

Once the dependency is set between two Select box - Database attributes, the options in the dependent attribute changes based on the selection made in the parent attribute.

Before you begin

See Creating custom attributes and Creating custom templates.

About this task

You can add a dependency, or modify an existing dependency, when you create a template or modify a template. The conditions for adding a dependency are as follows:

  • There must be at least two or more Select box - Database attributes added to the custom template.
  • If you want to establish dependency between Select box - Database attributes, you must ensure that the attributes exist either in the parameterized attributes section or the static attributes section.
  • If you want to add a dependency, you should add it between compatible attributes. Additionally, the option that you select for the key column of the parent attribute, should exist as one of the options in the key column of the child attribute, and it should have the same data type.
  • For better performance, when you assign a dependency, ensure that you create an index on the foreign key column of the dependent attribute.
  • For better performance, set the parent key as the primary key.
  • Avoid defining a circular dependency between attributes as it is not supported.
  • If you delete dependencies from an offer template, and if that offer template was used in multiple offers, the changes will reflect on all existing offers.
  • If you have used Select box - Database attributes in dependencies, you cannot delete it or move it to different attribute sections.
  • If you have defined a dependency between the Select box - Database attributes, do not change the table schema for the attributes.

Assigning attribute dependency

To assign attribute dependency, complete the following steps:

Procedure

  1. In the Default values section of the New Offer template or Edit Offer template page, click + Attribute dependency.
    The Add attribute dependency dialog appears.
  2. The dropdown on the left is the child attribute. Select the dependent child attribute.
  3. The dropdown on the right is the parent attribute. Select the parent attribute that the child attribute depends on.
  4. To add the dependency, click Add.
  5. To add more dependencies, perform step 2 through step 4.
  6. Click Save.
    The Default values section appears and you will see the dependency within the Dependent attributes section at the bottom of the page.

Modifying attribute dependency

To modify existing dependency, complete the following steps:

Procedure

  1. In the Default values section of the New Offer template or Edit Offer template page, click + Attribute dependency.
    The Add attribute dependency dialog appears.
  2. Click the row that you want to modify and update the child attribute, the parent attribute, or both.
  3. Click Save.
    The Default values section appears and you will see the updated dependency within the Dependent attributes section at the bottom of the page.

Deleting attribute dependency

To delete existing dependency, complete the following steps:

Procedure

  1. In the Default values section of the New Offer template or Edit Offer template page, click + Attribute dependency.
    The Add attribute dependency dialog appears.
  2. Click the icon succeeding the dependency to delete it.
  3. Click Save.
    The Default values section appears and you will see that the Dependent attributes section no longer exists.