on 03-11-2014 9:59 PM
Estimados
en la oferta de ventas (object type 23) he creado un campo de usuario que almacena cantidades (numeric 19,6) en la qut1
bueno debo crear un bloqueo para que no permita grabar la transaccion si no esta lleno el mismo
he aca mis intentos
IF @object_type = 23 and @transaction_type in ('A','U')
BEGIN
declare @referen varchar(10)
SET @referen = (select Top 1 t1.U_quant from QUT1 t1
INNER JOIN OQUT T0 ON T1.DocEntry=T0.DocEntry
WHERE T0.DocEntry = @list_of_cols_val_tab_del )
if @referen is null
begin
set @error = 1
set @error_message = 'Falta referencia22'
end
END
y esta otra
--IF @object_type=23 AND @transaction_type IN ('A','U')
--BEGIN
-- DECLARE
-- @Item NVARCHAR(20)
-- SET @Item = (
-- SELECT TOP 1 T1.U_Quant
-- FROM OQUT T0
-- INNER JOIN QUT1 T1 ON T1.DocEntry=T0.DocEntry
-- WHERE T0.DocEntry = @list_of_cols_val_tab_del )
-- IF @Item IS NULL
-- BEGIN
-- SELECT @error=777, @error_message='No puede cambiar la descripcion del articulo '+@Item
-- END
--END
no me funcionan
una ayuda por favor
Buenas
Prueba lo siguiente
IF @object_type=23 AND @transaction_type IN ('A','U')
BEGIN
DECLARE
@Item NVARCHAR(20)
SET @Item = isnull((
SELECT TOP 1 T1.U_Quant
FROM OQUT T0
INNER JOIN QUT1 T1 ON T1.DocEntry=T0.DocEntry
WHERE T0.DocEntry = @list_of_cols_val_tab_del ),'0')
IF @Item <> '0'
BEGIN
SELECT @error=777, @error_message='ERROR'
END
END
Saludos
FLR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hola martin, Intenta así:
IF @object_type = '23' AND @transaction_type in ('U','A')
BEGIN
IF (select count(*)
from QUT1 T0
where (T0.u_campo = '' or T0.u_campo is null)
and T0.DocEntry = @list_of_cols_val_tab_del)>0
begin
SELECT @error= 10
SELECT @error_message = 'Tu mensaje al usuario'
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 |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
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.