Get Property Value From An External Data Source
With the Database Item Search feature, you can link the Property's value to an item located in the external data source.
The external data source items available in the Property depend on which Database Search Group the Property is linked to. Use the Database Options page of the ATR CustomTools traditional Property Wizard to define the Database Search Group linking for the Property.
The
button in the
Properties pane opens the Get Database Item dialog box used to define the database column
linked to the custom property value.
When the
button is in the
clicked state, the link is enabled and the property value is composed based on other custom properties. If
the automatically created value needs to be overridden, you may click the button to break the link. The
property box becomes enabled and the desired data can be entered. The
button state is stored to the
SOLIDWORKS file.
In the Search conditions, you see the fields of the external data source that are linked to your Properties. However, the fields in the external data source associated with Properties that have the Exclude from item search condition option selected in the Property Wizard's Database Options page do not appear in the Search conditions.
| Search conditions | Search conditions contain Properties that use the specific database search group and are not excluded from the item search conditions. Select the Exclude from item search condition option in the Database Options of the Property to exclude the specific property from the search conditions. |
| Executes the search. | |
| Clears all the search conditions. |
Each field under the Search conditions can have a free search string to be searched from an external data source. Note that a checkbox has a mixed value when it is not used as a search condition; i.e., checked and unchecked values will restrict search results.
The Database Item Search remembers the last used search conditions, so the search strings you have used on the previous search are pre-filled into the search conditions when you next search items from the external data source.
| Close | Closes the Database Item Search dialog box without making any changes to the existing value of the Property. |
| Link |
Creates a link between the selected row and the specific Property. When the custom property gets
its value from the external data source with help of the link, the retrieved value cannot be modified by
the user using the Properties pane. To maintain a link, ATR CustomTools writes the specified
primary key value in the SOLIDWORKS file in order to locate the file in the external data source table
when needed.
All buttons related to any other properties using the same Database search group go to the disabled state once the link has been established from the custom property to an external data source. Disabling the buttons of other properties using the same Database search group prevents the unexpected overwriting of the linked values.
TIP:
A link to the database item can also be created by double-clicking the desired row in the
Search results.
|
| Remove link | Deletes the previously created link between the custom property and the row located in an external data source. |
| Copy | Copies the value of the selected row into the linked custom property field. |
The Search results list the matching rows from the external database based on the Search conditions.
Comboboxes react to a non-matching value in the following ways:
| Editable combobox | The current value will be replaced with the one retrieved from the database. |
| Combobox | Clears the value in the related property and leaves it empty. |