on 09-18-2012 8:26 PM
estimados tengo el sguiente TN
-- ORDR = ORDEN DE VENTA ------------------------------------------------------------------------------
-- Codigo vendedor bloqueo ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
IF @object_type='17' and (@transaction_type='U')
BEGIN
IF EXISTs (SELECT T0.SlpCode
FROM ORDR T0
WHERE T0.[DocEntry] = @list_of_cols_val_tab_del )
BEGIN
SET @error = 1
SET @error_message = 'NO PUEDE CAMBIAR EL VENDEDOR'
END
END
la intencion es bloquear una orden de venta ya creada para que no puedan cambiar el vendedor...
pero el problema es que si cambiamos por ejemplo el porcentaje de descuento tambien me bloquea
ayuda!!
gracias
Hola Martín
Prueba con este otro código
IF @object_type = '17' and (@transaction_type='U')
BEGIN
Declare @vendedor Int
Set @vendedor = (Select T0.SlpCode From ORDR T0 Where T0.SlpCode <> -1 and T0.DocEntry = @list_of_cols_val_tab_del)
If @vendedor > -1
Begin
Set @error = 1000
Set @error_message = 'No es permitido cambiar vendedor'
End
END
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
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.