IBM Support

Quick Case Data Lookups

Technical Blog Post


Abstract

Quick Case Data Lookups

Body

One of the most boring parts of a demo is watching someone slowly fill out a bunch of data fields. Often, however, good data is required to make the rest of the demo work. So what to do (besides learning to type really fast!)?

The Case Manager Client Case Data and Case Form widgets both support a couple of widget events that can make your demos fly. You can also use this technique in your real solutions as well.

The first event is a Field Changed event. This event is fired whenever you enter some data into the Case Data widget or a form and leave the field (by tab or click). The corresponding event is a Set Field event (and in ICM 5.1 a new Set Fields event) that allows you to pro grammatically set a fields value.

Here's how you do it:

Add a JavaScript widget to you page and in its settings, enter the script text like the following but change the property names to what yours are (note that a property is identified by its internal name).

  if (payload.value == '123-12345')       return [{'name':'DP720_ClientName','value':'Dave Perman'},{'name':'DP720_ExistingCustomer','value':true}];

Note that for ICM 5.0 you can only return a single field value using a non-array result (no square brackets) like:

  return {'name':'DP720_ClientName','value':'Dave Perman'};

Now wire the JavaScript widget to the data widget, both incoming and outgoing events.

Now enter the correct lookup value and press tab.

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSCTJ4","label":"IBM Case Manager"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

UID

ibm11281196