Wednesday, 5 February 2020

How to correctly define a Table Domain

Have you ever wondered what’s the difference between ‘Validation Where Clause’ and ‘List Where Clause’ in the Maximo Table Domain definition dialog?
I believe this is one of the most common misused features in Maximo. I have see so many times tables domains defined in the wrong way. Let me show a good example of a built-in table domain.
The ACTIVEUSER domain is used to allow the selection of an active user in the Cron Tasks application. Here are the domain details.
  • Domain: ACTIVEUSER
  • Object: MAXUSER
  • Validation Where Clause: userid=:runasuserid
  • List Where Clause: status in (select value from synonymdomain where domainid=’MAXUSERSTATUS’ and maxvalue=’ACTIVE’)
  • Error Message Group: signature
  • Error Message Key: NotActiveUser
Lets now analyze two key characteristics of this table domain, the validation where clause and the error message.

Error Message

If we open the Cron Tasks application and try to type some wrong value in the ‘Run As User’ field we will get a specific error: Run as User XXXYYYZZZ is not an active User
Removing the error message group/key from the domain definition we get the generic domain validation error: The value XXXYYYZZZ is not valid for Run as User
The error message group/key properties a Table Domain definition allow to display a more specific error message to the user when the entered value is not valid.
To further improve the error message you can use the {1} param to display the invalid value and the {0} param to display the field name the domain is tied to.

Validation Where Clause

The userid=:runasuserid statement in the Validation Where Clause ensures that the value entered in the field (CRONTASKINSTANCE.RUNASUSERID) matches a value in the data source table (MAXUSER.USERID).
To understand the reason why the Validation Where Clause is so important we can simply try to remove it and see what happens. After having modified the domain we can enter any value in the Run as User field !!!
This means that:
The Validation Where Clause must be always set to validate the entered value against the target table domain.
In our example userid is the attribute of the MAXUSER table that the domain is based on. Instead :runasuserid is the attribute of the CRONTASKINSTANCE table that you want to validate.

1 comment:

IBM Readme for IBM Maximo Asset Management 7.6.1.3 Fix Pack

  Fix Readme Abstract This fix pack updates IBM® Maximo® Asset Management version 7.6.1, 7.6.1.1, and 7.6.1.2 Content IBM Maximo Asset Manag...