The following domains allow conditionally displaying values.
- ALN
- Numeric
- Table
- Cross Over
- Synonym
ALN, Numeric and Synonym Domains
It is the same process to conditionally show values in ALN, numeric and synonym domains.
e.g. We have an object
TEST which have attributes STATUS and TYPE. Status has ALN domain for which valid values are only APPROVED, COMPLETE and PENDING. We want to show value of APPROVED only when another field (i.e. TYPE) is equal to NEW.Step 1: Create Condition
In Conditional Expression Manager create a new condition. Enter the following as the condition.
:type = 'NEW'Step 2: Assign condition to domain value
Open the domain in Domains application. Against the value
APPROVED click new row and select the condition created in previous step. Optionally you can also select the object.Check this in application.
Now it will only show the value
APPROVED when TYPE is NEW.Table and Crossover domains
There are two methods for conditionally displaying values for crossover / table domains
- Where Clause
For Table and Crossover domains the List Where Clause define the listing criterion
- Using an Automation Script
Set the domain using
domainidthe where clause usinglistWhereand order usinglistOrderimplicit variables on an attribute launch point based automation script. It should use the Retrieve List event
if attributeName == 'XYZ': domainid = "DOMAIN1" else domainid = 'DOMAIN2' listWhere = "company like 'ABC%'" listOrder = "company"
- Using Java Class
This class should be attached to an attribute in database configuration. Ideally the class should extend
MAXTableDomainand the logic is defined ingetList()function and where clause is set insetListCriteria(String var)function
public class AttributeList extends MAXTableDomain{ public AttributeList(MboValue mbv) throws MXException { super(mbv); } public MboSetRemote getList() throws MXException, RemoteException { MboRemote mbo = getMboValue().getMbo(); if (mbo.getString("DESCRIPTION").equals("XYZ"){ setListCriteria("company like 'ABC%'"); } return super.getList(); } }