TABLE domains are used for selecting dynamic value from an existing database table.
Difference between Crossover and Table domains:
Unlike table domains crossover domain can copy multiple attributes from the table. They can also have conditions defined on the source and destination table while copying data.
Unlike crossover domains Table domain only selects one single value from the table. Lookups are more important when using table domains, as most of the time built in lookups won’t be suitable for table domains.
When creating table domains there are two clauses.
- Validation where: It is a one to one relationship from source to destination object
- List where: It filters out the rows to be shown from the source table
Example: I have an object named TEST. In that I have an attribute called STATUS
The STATUS is ALN and it’s length is 20. We want to select values from another table i.e. TESTDOMAIN. It has values e.g. HOLD and COMP in status column
Step 1: Create Domain:
Goto Domains and create new TABLE Domain.
I will name this domain TABLETEST. In list view added a clause to show only those records whose status are APPR
Tip: There is also option of adding Organization and Site against each values. In that case these values would only be showed when a specific site is selected.
Error Message Group and Key are used to display error when a validation is failed.
Step 2: Database configuration
Open Database configuration and open the TEST object. Select the desired attribute (in our case its STATUS).
Select our created domain. Then configure database, adding or removing a domain from an attribute does not require admin mode to be turned on.
Step 3: Configure Lookup Map
In database configuration, clink on the Edit Lookup Map button against the Status row.
Lookup mapping is used to link a column of lookup table with your object's column.
This tells Maximo which column to copy when a row is selected. e.g. In this case when the lookup is selected in Maximo by user in application. It will copy the value of STATUS from table TESTDOMAIN to our current table’s STATUS value.
Fill the dialog as below. You might need to restart your server for this to take effect
Step 4: Create Lookup
In lookups.xml add the following to the bottom of your lookups.xml just before the
</systemlib>
tag.<table id=”testdomain” inputmode=”readonly” selectmode=”single”>
<tablebody displayrowsperpage=”20″ filterable=”true” filterexpanded=”true” id=”secrerurgroup_lookup_tablebody”>
<tablecol dataattribute=”STATUS” id=”securgroup_lookup_tablrebowdy_col_1″ mxevent=”selectrecord” mxevent_desc=”Go To %1″ sortable=”true” type=”link”/>
<tablecol dataattribute=”description” id=”securgroup_lookup_rwtablebody_col_2″ mxevent=”selectrecord” mxevent_desc=”Go To %1″ sortable=”true” type=”link”/>
</tablebody>
</table>
Step 5: Application Designer
Open the desired application and select the attribute and click on details and attach lookup we created in previous step to it. Use its id e.g. testdomain
Save
Step 6: View Results
Open your application to view the result. It will show only the filtered values
You can only enter these values. Any other value will throw an error.