Table of Contents



DELETE Node


Node in which the rules and actions for the elimination of collections will be described.

The format is the following one:

<delete>
     <!-- Condición para que se efectue el borrado -->
     <rule atributos>...</rule>
 
     <!-- Acciones a efectuar si la condición anterior se cumple -->
     <action atributos>...</action>
</delete>

<rule> Node


Node where the delete validation rules are defined.


<rule> Node Attributes


Example of Code


<delete>
     <rule value="eof" sql="SELECT ID FROM ##PREF##DetDocumento WHERE IDARTICULO=##ID##" errormsg="Se han efectuado movimientos con este articulo."></rule>
     <!-- Comprueba que no exista ningún movimiento de este artículo, en caso de existir mostraría un mensaje de error y no nos permitiría continuar con el borrado -->
</delete>


If all the rules have been favorable, the object can be deleted, so if the deleting actions are executed (those elements inside the delete definition which are of type “action”.

<action> Node Attributes



Example of Code


<delete>
     <!-- Ejecuta un delete de la tabla stock en la que el IDARTICULO sea el ID del artículo que se está eliminando -->
     <action name="executesql" sql="DELETE FROM ##PREF##Stock WHERE IDARTICULO=##ID##"></action>
</delete>
</coll>