Skip to main content

I want the message to abort so i added the '1’

When using '0’ it warns and everything is ok

 

See also live error log

 

Is this a bug?

Hi Theo,

Can you give us a little more insight? Is this message placed in the Default logic or another logic type? What does the whole code look like? Are there any other error occurring?


Mark,

 

It's a trigger

 

if exists (select 1 from inserted i              where egtin_col] is not null and len(ngtin_col]) >0 and len(ngtin_col]) <> 14 and len(ngtin_col]) <> 13          )begin exec dbo.tsf_send_message 'gtin_length_not_valid', null, 1end

Ah, I see. The (after insert) trigger is not the best place to handle this kind of logic as you want to prevent the insert/update from happening. I do think the behavior is intended.

I suggest using a Handler instead. With a handler, you have full control over the processing of the data. You can let the Insert/Update/Delete statement be generated by the Software Factory and only focus on the added business rule logic, such as throwing this message. Could you try that?


Mark,

But it's a dynamic trigger for more columns. Now i have to repeat this for every column.

 


Mark,

 

The docs are clear about this. I still think it's a bug 

 

Trigger/event

Trigger or Event based logic is performed around the data manipulation. This logic concept is highly platform dependent. It offers the following possibilities:

  • Perform actions as a result of (attempted) changes in data

  • Prevent or undo changes in data (control)

In general, the concept can be divided into three types, with three moments per type. The available context is different for each type.

  • Instead of / before / after performing a create action - The field values of the record(s) to be added or that have been added.

  • Instead of / before / after performing an update action - The old and new field values of the record(s) to be changed or that have been changed.


Hello @Theo Leijen,

To clarify, are you experiencing a functional problem as well or do you just want Indicium to not log an error in this case?

If you are experiencing a functional problem, can you elaborate on what is happening?


Hello Vincent

 

The functional issue is that i can create a dynamic  trigger for multiple fields but not use the error option to prevent input of wrong data


@Theo Leijen I tried to reproduce this but for me it works as you would expect. Since there could be several reasons why this does not work for you I created a ticket for this issue in TCP for you. If you could add a model export to this ticket I can investigate this further. 

The ticket number is 10476S


Reply