Domains: Crossover

Created
Nov 22, 2021 06:50 AM
Tags
configuration
Status
Completed
Created Date
 
CROSSOVER domains are used for copying multiple 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.
Lookups are more important when using table/crossover domains, as most of the time built in lookups won’t be suitable for table domains.
Like 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
Step 1: Create Domain:Goto Domains and create new CROSSOVER Domain.
notion image
I will name this domain CROSSOVERTEST .
notion image
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.
In the same dialog, in crossover fields select the source and destination field to get copied. A useful feature is that condition on source / destination can also be applied before the value is copied.
notion image
Step 2: Database configuration
Open Database configuration and open the TEST object. Select the desired attribute (in our case its STATUS).
notion image
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: 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 4: 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
notion image
Save
Step 5: View Results Open your application to view the result. It will show only the filtered values
notion image
You can only enter these values. Any other value will throw an error.