How to pass an error message to the Clarity application?

We've built a custom object in Clarity and now we want to enforce a business rule that only one row in the subobject can be marked as 'active' at a time. We've built a trigger that tests for this condition, but now the question is how to pass the error to the application? We've located the 'messages_en.properties' file in the Clarity\Resource folder, but we're not clear on how to define the error key in SQL. Is there another translation file that converts error numbers to the alphanumeric handles in the messages_en.properties file?

I haven't done this for the exact condition you're interested in but I've built something that will return a custom message on a delete trigger if an instance of a custom sub-object is deleted and it has a reference in WIP. This is what I used

I got the code by hunting around through the delete triggers that are on the OOB tables. It's then a case of putting the reference in the Messages_EN as you've noted and the restart the app server(s). Result shown in the attached.

HTH

Owen

Attachments

Hi Owen - this is helpful. Could you also share the line from your messages_en.properties file, because I'd like to see how you've entered the code and the message in the REVMGR section. I think we've made a syntax error, as the line we've added to our messages_en file (revmgr.99999=REVMGR-99999:Some testing Message.) is not being displayed when the trigger fires. Instead, we're getting the general "System error. Contact system administrator" message.

CREATE OR REPLACE TRIGGER NIKU.Z_TEST_FILES
BEFORE INSERT OR UPDATE
OF CATEGORY
ON NIKU.CLB_DMS_FILES
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
--z_count number:=0;
--rdddate date;
message GLOBALPKG.STRING;
BEGIN

When I click 'Add' without selecting the 'Category' field, I get the standard message - 'DMS-02102: A database error occurred while processing your request. Contact your system administrator.' instead of the custom message

CREATE OR REPLACE TRIGGER NIKU.Z_TEST_FILES
BEFORE INSERT OR UPDATE
OF CATEGORY
ON NIKU.CLB_DMS_FILES
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
--z_count number:=0;
--rdddate date;
message GLOBALPKG.STRING;
BEGIN

It seems you have some component in DB which is causing this issue.
Plz disable the trigger and see if you are able to save the document.
Or you remove the rasi_application_error from the triggre and see if u are able to save.