Skip to main content
Solved

BUG? Unknown error when tsf_send_message 'message',null, 1


Forum|alt.badge.img

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?

Best answer by Erwin Ekkel

@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

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

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

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?


Forum|alt.badge.img

Mark,

 

It's a trigger

 

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

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

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?


Forum|alt.badge.img

Mark,

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

 


Forum|alt.badge.img

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.


Forum|alt.badge.img+4

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?


Forum|alt.badge.img

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


Forum|alt.badge.img+16

@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


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