Question

tsf_send_message parameter issue

  • 8 July 2021
  • 4 replies
  • 54 views

We are trying to make a message work with some parameters but after we trigger the message the only thing we see is the translation message and not the values in the query

the only thing we see is this when we trigger the message:

This text is from the translation tab

What we have in our query is

/* Drop stored procedure def_purchase_order first. */

if exists (select 1 from sysobjects
where name = 'def_purchase_order' and type = 'P')
drop procedure def_purchase_order
go

create procedure def_purchase_order
(
@default_mode tinyint, -- 0 = add, 1 = update
@import_mode tinyint, -- 0 = regular, 1 = import row, 3 = import
@cursor_from_col_id varchar(255), -- column that triggered the default
@cursor_to_col_id varchar(255) output, -- cursor in column after leaving the default

@purchase_order_id purchase_order_id output,
@id id output
)

as
begin

-- Do not count affected rows for performance
SET NOCOUNT ON;


--control_proc_id: def_scan_purchase_order
--template_id: def_scan_purchase_order
--prog_object_item_id: def_scan_purchase_order
--template_description:

declare @warehouse_id as nvarchar(50)
declare @warehouse_name as nvarchar(100)
declare @msg_parameter as nvarchar(500)

if @purchase_order_id <> ''
begin

if (select purchid from [xxx].[xxx].[dbo].[purchtable] where purchid = @purchase_order_id) is not null
begin
set @warehouse_id = (select inventlocationid from [xxx].[xxx].[dbo].[purchtable] where purchid = @purchase_order_id)
set @warehouse_name = (select name from [xxx].[xxx].[dbo].[inventlocation] where [inventlocationid] = @warehouse_id)
set @msg_parameter = (select CONCAT('<text>', 'Inkooporder', @purchase_order_id, 'is bedoeld voor' , @warehouse_id, ' - ', @warehouse_name, '</text>'))

exec tsf_send_message 'purchase_order_info', @msg_parameter, 0
end

if (select purchid from [xxx].[xxx].[dbo].[purchtable] where purchid = @purchase_order_id) is null
begin
set @msg_parameter = (select concat('<text>', 'Inkooporder' , @purchase_order_id, 'is niet gevonden!','</text>'))
exec tsf_send_message 'purchase_order_not_found', @msg_parameter, 0
end
end


end
go

grant execute on def_purchase_order to public
go


I am probably missing something but I just do not see what I am missing

 

I hope the information is clear enough if not please let me know so I can elaborate


4 replies

We have fixed this issue :)

Userlevel 5
Badge +9

Do you have a parameter set up in the message? They need to be set up in the translation like this {0}, see example below.
 

 

I can try that as well, we did manage to get what we want though, but I will play with what you said as well :)

Userlevel 6
Badge +18

@Dennis de Jong, did my colleague's suggestion solve the challenge?

Reply