Attribute Extensions

You can use query view extensions to make attribute categories available as columns in list builders. You enable these attribute extensions through the Blackbaud CRM user interface, and the platform creates query view extensions under the hood for them. For a list builder with the appropriate settings in place on its query view spec, the attribute categories are then available as columns. If you enable an attribute extension and the attribute category is not available on a list builder, you can edit its query view spec to accept attribute extensions.

For information about attributes and attribute extensions, see the Attribute Categories chapter of the Blackbaud CRM Administration Guide.

You can use the following procedure to create attribute extensions for query views.

  1. In Administration, click Attribute categories under Data. The Attribute Categories page appears.

  2. On the Attribute Categories tab, create an attribute category or edit an existing one.

    • To add an attribute category, click Add. The Add an attribute category screen appears. Select Make available in lists, then enter the rest of the information for your new attribute category and click Save.

    • To edit an existing attribute category, select it in the grid and click Edit. The Edit attribute category screen appears. Select Make available in lists and click Save.

    You return to the Attribute Categories page , and the platform creates a query view extension for the attribute category. For any list builder with the appropriate settings on its query view spec, the attribute category now appears as a column in the Columns dropdown list.

  3. To display the attribute category as a column, go to the page with the list builder and select the attribute category's checkbox in the Columns dropdown list.

    If the attribute category does not appear as a column in the Columns dropdown list, then the list builder's query view spec is not set up for it. You must update the query view spec to accept attribute extensions.

  4. In the query view spec's root QueryViewSpec element, add the AllowAttributeExtension attribute and set it to "true."

    AllowAttributeExtension="true"
  5. After the QueryViewSpec element, add the Extensibility element and its child Tables element to list the tables that are available to extend.

  6. Within the Tables element, add the Table element and enter the name of the attribute category table to extend in the Name attribute. You can also add the optional Alias attribute to provide an alias for the table.

  7. Within the Table element, add the AttributeExtension element to provide information about creating attribute extensions for the view. In the AttributeRecordType attribute, enter the record type of the attribute category. You can also add the optional JoinField attribute to specify a field to use when joining the view to the attribute category table. By default, the ID field is used.

    <Extensibility>
    <Tables>
    <Table Name="REPLACE_WITH_TABLENAME">
    <AttributeExtension AttributeRecordType="REPLACE_WITH_RECORDTYPE" />
    </Table>
    </Tables>
    </Extensibility>
  8. In the TVFImplementation element's CreateFunctionSQL element, add "/*#EXTENSION*/" in the SELECT statement. This comments acts as a placeholder for where the attribute extension can append a subquery to the SQL.

    <TVFImplementation FunctionName="USR_UFN_REPLACE_WITH_FUNCTIONNAME">
    <CreateFunctionSQL>
    <![CDATA[
    create function dbo.USR_UFN_REPLACE_WITH_FUNCTIONNAME()
    returns table
    as
    return
    select
    REPLACE_WITH_TABLENAME.REPLACE_WITH_FIELD1NAME,
    REPLACE_WITH_TABLENAME.REPLACE_WITH_FIELD2NAME,
    REPLACE_WITH_TABLENAME.REPLACE_WITH_FIELD3NAME
    /*#EXTENSION*/ from dbo.REPLACE_WITH_TABLENAME
    ]]>
    </CreateFunctionSQL>
    </TVFImplementation>
  9. With the appropriate settings for your attribute extension now in the query view, the attribute category now appears as a column in the list builder's Columns dropdown list. To display the attribute category as a column, go to the page with the list builder and select the attribute category's checkbox in the Columns dropdown list.