on 08-31-2009 6:36 PM
Hola a Todos!
En los documentos de venta me piden validar el numero de lineas de documento, si es mayor a 15 que no cree el documeto. para esto estoy desarrollando un SBO_SP_TransactionNotification que es el siguiete:
F @transaction_type IN ('A') AND @object_type = '22'
BEGIN
if exists (Select T0.LineNum from [dbo].[INV1] T0 where T0.LineNum > 15 AND T0.DocEntry = @list_of_cols_val_tab_del )
begin
SELECT @error = 1, @error_message = 'Numero de Partidas > 15'
end
END
Espero que me puedan ayudar.
Gracias!
MS
Viendo una consulta entre la OINV y INV1 el LineNum de la INV1 empieza desde cero, entonces en la condicion que sea 14 para que tome el cero (0) y aplique la condición.
Aprovechando, puedo anidar la condicion para todos los documetos de venta o debe ser condicion por documento.
Gracias!
MS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola
Tus codigos son:
F @transaction_type IN ('A') AND @object_type = '22'
BEGIN
if exists (Select T0.LineNum from dbo.INV1 T0 where T0.LineNum > 15 AND T0.DocEntry = @list_of_cols_val_tab_del )
begin
SELECT @error = 1, @error_message = 'Numero de Partidas > 15'
end
END
F @transaction_type IN ('A') AND @object_type = '13'
BEGIN
if exists (Select T0.LineNum from dbo.INV1 T0 where T0.LineNum > 15 AND T0.DocEntry = @list_of_cols_val_tab_del )
begin
SELECT @error = 1, @error_message = 'Numero de Partidas > 15'
end
END
Practicamente cambiaste el documento sobre el cual querias aplicar la validacion...sin embargo, veo un detalle..
debes considerar que las líneas de los documentos parten desde CERO, por lo tanto si dejas este transaction así, me parece que te permitirá 16 líneas.
Chequea esta consideración y me avisas
Saludos,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ya supe como es de esta manera
F @transaction_type IN ('A') AND @object_type = '13'
BEGIN
if exists (Select T0.LineNum from [dbo].[INV1] T0 where T0.LineNum > 15 AND T0.DocEntry = @list_of_cols_val_tab_del )
begin
SELECT @error = 1, @error_message = 'Numero de Partidas > 15'
end
END
Gracias!
MS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
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.