Lookups With SXP Extensibility
First published on: 03/20/2025/12:00 pm
Lookups can be used to add choose from lists to fields on grids and forms.
Set up the lookup in the data store.
On a data-store level, you can define a field that will be used as a lookup field.
This field will be used in a query into SAP Business One and will return a result that can map the values into one or more record fields.
Consider this use case:
Proposed functionality for users to open a lookup, enter pre-filter text based on the item description and/or item code, and subsequently select the desired item. Upon selection, the lookup will populate fields on the main grid at the detail level, including item code, item description, unit price, and GL account.
To set up a lookup:
- Go to the data store page
- Select the column that will serve as the lookup source
- Check the 'Enable Lookup' option
- Click on the lookup icon to open the configuration.
- The dialog will load all available connector configurations on your project.
- Select the connection, category, and specific query to be used.
- Once the query is selected, you'll see the source columns populated (in blue), which reflect the columns returned by the query
- It's up to the data store designer to populate the target columns (in green).
- Select the display name for the query returned columns.
- Choose which column will receive the value from this column.
- Save the configuration.
- In the data store, you'll get an indication for each column that's populated from the lookup result, with a tooltip about where the value comes from.
- Use the lookup setup in an actionable grid.
- Go to the actionable grid setup page, where 'Enable Lookup' is enabled by default for the columns you set up.
- You can uncheck this option.
- Go to the actionable grid setup page, where 'Enable Lookup' is enabled by default for the columns you set up.
- Open your grid.
- You'll see a lookup option next to the column where the lookup is configured on the grid and form view.
- Click on the lookup icon.
- Your query will run and return results.
- Select the entry you're looking for, and target columns will receive the selected value.
- Your query will run and return results.
This window also supports searching in the query result.
Use the lookup setup in a form:
- Go to the form.
- The lookup option will be enabled by default on the relevant fields.
- You can uncheck this option.
- The lookup option will be enabled by default on the relevant fields.
- At run time, when clicking on the lookup, the user will get the query results and can select the needed result row.
- This dialog supports searches in the results.
- Select a result row, and all mapped columns will get the resulting values.
** Values populated by the lookup can be overridden by the user when the field is editable.