on 2012 Jul 31 3:44 PM
Hola a todos
Estoy realizando un bloqueo para que los vendedores o cualquier otra persona no pueda modificar la descripcion de un articulo en los documentos de marketing. Tengo el codigo, pero cuando hago la prueba haciendo una orden de venta y cambio la descripcion me manda el error; sin embargo, cuando coloco la descripcion correcta igual me manda el error y no deberia. Si me pueden ayudar para ver que me hace falta en el codigo se los agradeceria
If
@Object_Type = '17' and @transaction_type in ('A','U') and
(select top 1 'true' from RDR1 t0, OITM t1 where t0.Dscription <> t1.ItemName) = 'true'
begin
Set @error = -1
Set @error_message = 'Descripcion de la referencia no puede ser modificada'
end
Request clarification before answering.
La validacion en el transaction debiera ser algo como lo siguiente:
If
@Object_Type
= '17' and @transaction_type in ('A','U')
begin
declare
@cantidad as int
set
@cantidad =(select *
from
ORDR t0
inner
join RDR1 t1 on t0.DocEntry=t1.DocEntry
and
t0.docentry= @list_of_cols_val_tab_del
inner
join OITM t2 on t1.ItemCode=t2.ItemCode and t1.Dscription <> t2.ItemName
)
if
@cantidad > 0
begin
Set
@error = -1
Set
@error_message = 'Descripcion de la referencia no puede ser modificada'
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 |
---|---|
18 | |
10 | |
8 | |
7 | |
7 | |
6 | |
6 | |
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.