on 10-22-2014 5:48 PM
Buen día colegas, solicito de su ayuda para lo siguiente, debo generar un bloqueo para el campo 'Cantidad Planificada' en la Orden de Fabricación lo que se requiere es que despues de liberada la ODF no se pueda modificar el campo Cantidad planificada por los operarios sólo el usuario LIDERPRO pueda modificar si es necesario. Tengo esta consulta en TN pero me sigue permitiendo la actualización. De antemano agradezco de su colaboración.
if @transaction_type in ('U','A') and @object_type='202' | ||
begin | ||
declare @cant char(1) | ||
set @cant=(select 'A' from OWOR T0 where T0.DocEntry=@list_of_cols_val_tab_del and T0.UserSign2 not in (48) and | ||
t0.PlannedQty<>(select top 1 t1.PlannedQty from AWOR t1 where t1.DocEntry=@list_of_cols_val_tab_del order by t1.LogInstanc asc)) | ||
if @cant is not null | ||
begin | ||
set @error=30 | ||
set @error_message='No puede modificar, comuniquese con el usuario LIDERPRO' | ||
end | ||
end | ||
Hola Christian,
intenta ordenando el historial descendientemente (DESC)
(SELECT TOP 1 T0.PlannedQty FROM AWOR T0 WHERE T0.DocEntry = @list_of_cols_val_tab_del ORDER BY LogInstanc DESC)
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 |
---|---|
88 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.