on 07-14-2010 10:24 PM
Tengo un transaction notification donde bloquea lineas de articulos duplicados. Este funciona cuando el almacen es el mismo, pero si tengo dos lineas con el mismo articulo pero de almacenes diferentes tambien me lo bloquea y no debe ocurrir. Debe permitirmelo. Les coloco el codigo para ver si me pueden ayudar.
IF @object_type = '17' and @transaction_type in ('A','U')and
(Select Distinct 'True' FROM RDR1 T1 WHERE T1.Docentry = @list_of_cols_val_tab_del
Group by T1.Itemcode Having count (T1.Linenum)>1)='True'
BEGIN
SET @error=-102
SET @error_message= 'Politica Interna:Imposible continuar,elimine articulos duplicados: ' +
(Select Dbo.ArticulosDuplicadosDocumento ('17',@list_of_cols_val_tab_del))
END
Gracias
SD
Deberías añadir en el GROUP BY el almacen:
GROUP BY T1.ItemCode AND T1.WhsCode
Saludos.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Me parece que te falta una validacion similar para el almacen, donde ademas de revisar las lineas duplicadas por item, valide que el almacen sea diferente, para el articulo duplicado
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
3 | |
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.