In this example we are going to add the Case List widget to our Work page. When the user clicks on a row in an In-basket, we are going to display all cases related to customer whose name is associated with the work.
- Add the Case List widget to your Work page
- Add the Case Search widget
- Add the Script Adapter widget
- Add the Event Explorer widget
- Wire the Event Explorer widget to the Case Search widget's Search Cases as CaseSearch event
- Using the Advanced Search of the Case Search widget, perform a search on the property you are going to use as your search key
- You will see the search payload appear in the Event Explorer widget
- Highlight over the payload text in the Event Explorer and copy it
theEvent = paste_your_event_payload_here; return theEvent;
- Edit the query text line to look like this:
"QuerySQL": "SELECT * FROM CCDM_ManageDisputeItem WHERE (CCDM_CustomerName = '" + payload + "' AND CmAcmCaseState = 2) "
How this works
The key to this is the fact that the Case List widget gets its entire search and display information from an inbound event. Typically, the Case Search widget wires that in when you enter something in and click the Search button.
Update. Turns out the payload sent from the search includes the current target object store name. This fine until you try deploying to a different target. To fix this, instead of this line:
"ObjectStore" : "Your_TOS_Name"
"ObjectStore" : ecmwdgt.getBean("spaceConfig").getTargetOS()
as described in the tip Accessing Case Manager Settings.