Customizing the "Case ID" |
Some offices need to generate a case ID automatically using a set of predetermined criteria. For example: it may be WP-420123 to show that the case is of type "WP", or "420123/2007" to show that it is a case from 2007. There is a way in LCM to create a custom function which will generate this case ID.
Warning: If the field is customized, it is is generated using case information every time that it is displayed. At the moment, the resulting information is not cached, therefore it may have a performance impact on very large systems.
To declare a custom function, declare the following in your my_options.php file:
In the same file, you may then declare the custom function to generate the case ID.
Here is a sample function, which takes the "code" of a custom field (keyword) and uses it to prefix the case id:
In the above function, the group ID (8) is hardcoded. To get the group ID, you must go to the "Custom fields" menu, then "Your fields" tab, and hover over the "Modify custom group" button, in order to get the group ID. This will hopefully be improved in future versions of LCM.
Therefore, if the custom field had a name "WP" and the case ID was 420123, the displayed case ID would be WP-420123.
Here is a different function, which uses the date creation date to generate a case ID in the form "420123/2007":