PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Example: Synchronizing the replicas by using a filter procedure
HSynchronizeReplica (Example)
Example: Synchronizing the replicas by using a filter procedure
Windows MobileHFSQL 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:\Data", "D:\Temp", rplToSubscriber, FilterReplica) = True THEN
Info("Replication performed")
END
PROCEDURE FilterReplica()
ProgressBar(RPL.OperationNum, RPL.OperationMax)
// ******************************** Filter the records ********************************
// Example: Exporting the catalog of bargains
IF RPL.Direction = rplToSubscriber AND RPL.Operation = rplHAdd THEN
 IF RPL.File = "Product" AND {RPL.SourceAlias + ".BARGAINS"} = False THEN
  // The record must not be copied
  RESULT False
END
END
// ************************************** Management of conflicts ***********************************
// Example: Checks whether the product already exists
// HReadSeek(PRODUCT, ProductCode, {RPL.SourceAlias + ".ProductCode"})
// IF HFound() THEN
// // The record must not be copied
// RESULT False
// END
// No problem was detected
RESULT True
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment