Skip to Content
0
Dec 03, 2009 at 09:35 PM

TransactionNotification and PostTransactionNotice doesnt work

154 Views

Hello, im trying to trigger an insert to another DB data once i import via DTW an oInventoryGenEntry

I knew from some related posts that the SP_PostTransactionNotice is the new sp to do this, after some versions of SBO2005, but i´m trying to do this with this code, and nothing seems to be triggered.

This is the code, the idea is that whenever a user confirms that the good receipts is on sbo, with just a UDF, the document ask for update, and the process begins.

USE

-- ADD YOUR CODE HERE

IF @transaction_type in ('A') AND @object_type IN ('59')

BEGIN

select @tda=o.fedtaxid,@tipotranE =b.datasource

from owhs o,ign1 a inner join oign b on a.docentry = b.docentry

where b.DocEntry =convert(int,@list_of_cols_val_tab_del) and o.whscode=u_almacenes

if len(@tda)>0and @tipotranE ='O'

begin

select @numero=Correl_Actual+1, @serie = serie from OPENQUERY(,'select * from POSDOS.dbo.Tbl_TipoMovBodega')

where cod_tipo = '105'

insert into .POSDOS.dbo.TblDet_MovBodega

select @serie'-'replicate('0',6-len(@numero))+@numero, '105', a.itemcode,

sum(a.quantity*(c.u_divisor/c.numinsale)), 0, rtrim(isnull(b.ref2,''))' 'rtrim(isnull(b.comments,'')), o.fedtaxid

from owhs o,ign1 a inner join oign b on a.docentry = b.docentry

inner join oitm c on c.itemcode = a.itemcode

where b.DocEntry = convert(int,@list_of_cols_val_tab_del) and o.whscode=u_almacenes

group by a.itemcode, rtrim(isnull(b.ref2,''))' 'rtrim(isnull(b.comments,'')), o.fedtaxid

insert into .POSDOS.dbo.Tbl_MovBodega

select @serie'-'replicate('0',6-len(@numero))+@numero, '105', user_code, a.docdate, '', u_almacenes, 'C', a.docdate, user_code, docnum, docdate, '0','0', 'C', o.fedtaxid

from owhs o,oign a inner join ousr b on a.usersign = b.userid

where a.DocEntry = convert(int,@list_of_cols_val_tab_del) and o.whscode=u_almacenes

select @u_almacen= u_almacenes

from oign a inner join ousr b on a.usersign = b.userid

where a.DocEntry = convert(int,@list_of_cols_val_tab_del)

insert into .POSDOS.dbo.tbl_mensaje values (@mensaje,@serie,@serie'-'replicate('0',6-len(@numero))+@numero,'',@u_almacen,0)

update .POSDOS.dbo.Tbl_TipoMovBodega

set correl_actual = @numero

where cod_tipo = '105'

end

END

-

-


-- Select the return values

select @error, @error_message

end

any idea???

Regards!