Skip to main content
Open

Support custom messages on custom constraints

Related products:Software Factory

It is possible to create a custom constraint on a table, so you can add specific checks without having to create a trigger. The message can be created with a dynamic model procedure like this:

insert into #msg
(
    msg_id 
   ,msg_description 
   ,msg_location_id 
   ,severity 
   ,msg_error_code 
   ,msg_regular_expression 
)
select 'err_check_constraint_' + tcc.check_constraint_id                    as msg_id          
     , 'Translation for check constraint error: ' + tcc.check_constraint_id as msg_description          
     , 'popup' as msg_location_id          
     , 0 as severity                 --error          
     , 547 as msg_error_code         --error code when check constraint fails          
     , '.*"' + tcc.check_constraint_id + '".*' as msg_regular_expression --regex that will find the specific constraint 
from tab_check_constraint tcc       
where tcc.model_id = @model_id 
  and tcc.branch_id = @branch_id 
  and tcc.generated_by_control_proc_id is null --only manual

 

Then, you have to search in generated translation objects, or the message, with the name of the constraint in it. It would be very helpful, when you can translate the message as a detail of the constraint, just like you can do this on for example a column. The trick now, that it is not a translation, but a message with a translation. 

 

The idea is, that this message object is automatically generated, and that it is available on the constraint as a detail, so you can directly translate it. You need this, don't you?

Did this topic help you find an answer to your question?

3 replies

Robbert van Tongeren
Thinkwise blogger

As an addition I would like to opt for a checkbox on the constraints table, something in line of: “translate” (generate_transl_object), the same way it works on table variants.
This way the SF can automatically add the message and the tab page to translate.


Mark Jongeling
Administrator
Forum|alt.badge.img+23
The following idea has been merged into this idea:

All the votes have been transferred into this idea.

Mark Jongeling
Administrator
Forum|alt.badge.img+23
NewOpen

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings