ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / Managing databases / HFSQL / HFSQL functions
  • Example: Synchronizing the replicas by using a filter procedure
HSynchronizeReplica (Example)
Example: Synchronizing the replicas by using a filter procedure
WINDEVWEBDEV - Server codeReports and QueriesUser code (UMC)AjaxHFSQL ClassicHyper File 5.5 The following example uses a WLanguage procedure during the replication. This FilterReplica procedure is used to filter the records that must be taken into account during the replication and to manage the replication conflicts.
IF HSynchronizeReplica("C:\Données", "D:\Temp", rplToSubscriber, FiltreRéplica) = True THEN
	Info("Réplication effectuée")
END
PROCEDURE FiltreRéplica()
ProgressBar(RPL.OperationNum, RPL.OperationMax)
// ******************************** Filtrage des enregistrements ********************************
// Exemple : Exportation du catalogue des produits en promotion
IF RPL.Direction = rplToSubscriber AND RPL.Operation = rplHAdd THEN
	 IF RPL.File = "Produit" AND {RPL.SourceAlias + ".PROMO"} = False THEN
		  // L'enregistrement ne doit pas être copié
		  RETURN False
	END 
END
// ************************************** Gestion des conflits ***********************************
// Exemple : Test si le produit existe déjà
// HLitRecherche(PRODUIT, CodeProduit, {RPL.AliasSource + ".CodeProduit"})
// SI HTrouve() ALORS
// // L'enregistrement ne doit pas être copié
// RENVOYER Faux
// FIN
// Pas de problème détecté
RETURN True
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help