FAQ: how to validate task custom field values using trigger

Discuss problems installing or using TrackStudio.

FAQ: how to validate task custom field values using trigger

Postby admin » Thu Aug 17, 2006 1:49 pm

The following Create Task / BEFORE trigger throw an exception if value of the "Exists in Production" custom field is not defined or equals "Please Choose" (default).

Code: Select all
HashMap udfs = task.getUdfValues();
if (udfs.get("Exists in Production")==null || udfs.get("Exists in Production").equals("Please Choose"))
throw new UserMessageException("No value selected for the Exists in Production field!");
return task;
Maxim Kramarenko (mailto: maximkr@trackstudio.com)
TrackStudio - Hierarchical Bug & Issue Tracking Software
http://www.trackstudio.com
admin
Site Admin
 
Posts: 8148
Joined: Thu Jan 01, 1970 3:00 am
Location: Smolensk, Russia

Return to TrackStudio Support

Who is online

Users browsing this forum: Google [Bot] and 12 guests

cron