on 06-11-2010 4:08 PM
Saludos compañeros del foro,
Tengo una validacion por SP_TransactionNotification para hacer obligatorio el Centro de beneficio en el formulario PAGOS RECIBIDOS, pero NO me funciona, he probado de varias maneras sin obtener el resultado, si alguien me puede dar una mano lo sabre agradecer. este es mi SP_TN:
if @object_type in ('24') begin --Objeto PAGOS RECIBIDOS
if @transaction_type in ('U','A')begin --Actualización o Creación
if (select count(*)
from RCT2 T0
where (T0.OcrCode = ' ' or T0.OcrCode is null)
and DocEntry = @list_of_cols_val_tab_del)>0 begin
set @error= 10
set @error_message = '*****FALTA EL CENTRO DE BENEFICIO - SP Transaction Notification'
end
end
end
O de esta otra manera:
IF @object_type = '24' AND @transaction_type in ('U','A')
BEGIN --Actualización o Creación
DECLARE @CONT NVARCHAR(5)
SET @CONT =(SELECT COUNT('1') FROM RCT2 T0
WHERE (T0.OcrCode = '' or T0.OcrCode is null) AND T0.DocEntry = @list_of_cols_val_tab_del)
IF @CONT>0
BEGIN
SELECT @error= 1
SELECT @error_message = '*****FALTA EL CENTRO DE BENEFICIO - SP Transaction Notification'
END
END
Saludos.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola Hector,
gracias por responder, probè las dos recomendaciones que me haces pero NO funciona, no valida el centro de benefico al hacer pagos recibidos.
El SP que presento me funciona para otros documentos como facturas de clientes, proveedores, NC, ND, entradas y salidas de inventario, pero en PAGOS RECIBIDOS NO.
saludos,
Hola de nuevo.
Revisando el código encontré esto: el campo clave no es DocEntry sino DocNum. Intenta con este nuevo:
IF @object_type = '24' AND @transaction_type in ('U','A')
BEGIN --Actualización o Creación
IF (select count(*)
from RCT2 T0
where (T0.OcrCode = '' or T0.OcrCode is null)
and T0.DocNum = @list_of_cols_val_tab_del)>0
begin
SELECT @error= 10
SELECT @error_message = '*****FALTA EL CENTRO DE BENEFICIO - SP Transaction Notification'
end
end
Saludos.
Hola.
Ya lo probaste así?:
IF @object_type = '24' AND @transaction_type in ('U','A')
BEGIN --Actualización o Creación
IF (select count(*)
from RCT2 T0
where (T0.OcrCode = '' or T0.OcrCode is null)
and DocEntry = @list_of_cols_val_tab_del)>0
begin
SELECT @error= 10
SELECT @error_message = '*****FALTA EL CENTRO DE BENEFICIO - SP Transaction Notification'
end
end
Saludos.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.