Description:
We created a dynamic query lookup and attached it to a multi-value lookup attribute on the Incident Object.
When this attribute is placed on the Incident [Layout:Edit] page and one or more values are selected and saved, the page generates a red system error message.
Steps to Reproduce:
- Login to Clarity as an Administrator
- Admin Tool > Data Administration: Lookups > click 'New' button to create a new lookup
Lookup Name: myIncidentLookup
Lookup ID: myIncidentLookup
Lookup Type: Dynamic Query
Lookup Query: Select incident_code, subject from imm_incidents
Click 'Save and Continue' button
- Parent Window
Hidden Key = incident_code
Display Attribute = subject
- Admin Tool > Studio Objects: Incidents > Attributes
Click 'New' button
Attribute Name: myIncidentMVL
Attribute ID: myincidentmvl
Data Type: Multi Valued Lookup - String
Lookup: myIncidentLookup
Click 'Submit' button
- Object Definitions: Views > Incident Properties [Layout:Edit]
Add 'myIncidentMVL' attribute to the Edit properties page
Click 'Submit' button
- Main Application > Incidents
Open an existing Incident
Select 1 or more values for the new attribute
Click 'Save' button
Expected Result: No error should appear
Actual Result: Red System Error message appears. App-Niku.Log file shows the following error message:
ERROR 2011-01-11 01:28:41,867 [http-80-Processor13] niku.xql2 (admin:13224894__-d90e892:itl.incidentObjectSaveU)
Internal Processing exception java.lang.IndexOutOfBoundsException: Index: 2, Size: 2 ...
Solution:
The error message is generated because the Lookup Query definition is not constructed properly.
- Login to Clarity as an Administrator
- Admin Tool > Data Administration: Lookups > search for 'myIncidentLookup'
- Modify the query as follows:
SELECT @SELECT:incident_code:[email protected],
@SELECT:subject:[email protected]
FROM imm_incidents
WHERE @[email protected]
- Main Application > Incidents
Open the same Incident used earlier where values were selected and saved.
No error message appears and the previously saved values appear in the field.