Skip to main content
Solved

Pass message to indicium

  • November 24, 2023
  • 3 replies
  • 86 views

Blommetje
Forum|alt.badge.img+13

Hi, 

I have a subroutine ‘delete_project’. When I call this, it deletes the project. When a record has Referential Integrity and ‘No Action’, Indicium nicely respond with a base64 encoded message that it ‘ can’t delete due to Related <tablename>’ . So far, all good. 

However, when I don’t want to delete the project because it has for example a [status] = ‘active’ - so deleting is not allowed. In the gui we can display a message. Or with importing some data from an API, at the end we show a success/failure message; perhaps with a Process flow.  

Is it possible - and if so, how - to pass these messages through Indicium? If a user connects with the end-point, it will make a lot more sense then a 422 - unprocessable entity when something is not allowed, or processed correctly.

Thanks! 

Blommetje 

Best answer by Blommetje

Yes, seems to work! Thanks!

This topic has been closed for replies.

3 replies

Remco Duijsens
Vanguard
Forum|alt.badge.img+1

For this you want to use the SQL RAISERROR function in your stored procedures. 

For example: 

If @status = ‘active’

begin

   raiserror()

end

If you want to know more about this function you can check https://learn.microsoft.com/en-us/sql/t-sql/language-elements/raiserror-transact-sql?view=sql-server-ver16


Forum|alt.badge.img+4

Hello Blommetje,

I would recommend using tsf_send_message, which uses raiserror, but allows you to send translated messages that are managed in the SF.

I hope this helps.


Blommetje
Forum|alt.badge.img+13
  • Author
  • Partner
  • Answer
  • November 28, 2023

Yes, seems to work! Thanks!