Buenas tardes, es posible crear una TN que impida generar dos veces un documento preliminar (Oferta ventas)?
Intenté con lo siguiente pero no me funciona:
if @object_type='112' and @transaction_type in ('A')
begin
--OC PRELIMINARES--
if (select T0.ObjType from ODRF T0 where T0.DocEntry=@list_of_cols_val_tab_del)='17'
begin
if (select T0.DocType from ODRF T0 where T0.DocEntry=@list_of_cols_val_tab_del)='I'
begin
if exists(select 'A' from ORDF A where A.DocEntry=@list_of_cols_val_tab_del and isnull(A.DocStatus,'C')='C')
begin
set @error=1234
set @error_message='Documento ya creado'
end
end
end
end