Example 3: Use SQL Data Source in custom field configuration
These examples demonstrate SQL Data Source configuration for Power Custom Fields (PCF), including autocomplete customization. They use the following configuration components:
One data source of type: SQL Data Source
Data source JNDI: Resource name of the target database, which must be preconfigured through the SQL Data Source setup.
SQL Initial Script: Filters database results for custom fields when autocomplete is disabled or when minimum characters value is 0.
SQL Autocomplete Script: Custom script for custom fields with autocomplete.
Example 1
This example uses:
The PCF - Multiple Autocomplete custom field with Minimum characters set to 0 and filtering set to Data source.
The following SQL Initial Script:
select brand from car_parts
where name like 'Door';
This example script returns the following result:
The following SQL Autocomplete Script:
select name from car_parts where brand like {query} || '%';
This example script returns the following result:
Example 2
This example uses:
The PCF - Single Autocomplete custom field with Minimum characters set to 3 and filtering set to Data source.
The following SQL Autocomplete Script:
select brand from car_parts where brand like {query} || '%';
The SQL Initial Script is required, even when using SQL Autocomplete.
This example script returns the following result:
Example 3
This example uses:
The PCF - Checkbox custom field.
The following SQL Initial Script:
select id from car_parts where brand like 'Toyota'
This example script returns the following results:
Contents: See also: More use cases: |
---|
Related content
Need support? Create a request with our support team.
Copyright © 2005 - 2025 Appfire | All rights reserved.