Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
5
Erster Beitrag:
vor 3 Jahren
Letzter Beitrag:
vor 3 Jahren
Beteiligte Autoren:
SolutionJ-Reg, MvdW, issah, Art Bonds

Replication and Automatic IDs

Startbeitrag von SolutionJ-Regam 18.05.2010 06:50

Morning all,

WinDev12 in use....

I have a client who wants to have access to a HFCS application I've developed when he's away from the office. As he might not have internet access at a particular moment I'm tihnking of using Replication, however I can't find out how WD handles Automatic ID fields for tables that might be added to in both the Master and Subscriber environments.

e.g.

Sales Order table has automatic SalesOrderID

While the guy is away, someone adds a new sales order to the 'master' database. The guy also adds a new sales order to the 'subscriber' database.

The guy returns, the databases are synchronised. What happens to the duplicate SalesOrderID field?

Cheers
Reg
Antworten:
I have an application that has similar requirements though I do not use Windev replication.

If the head office is "HQ" and the salesman pc is "SM" then the primary key becomes:
Id+SalesOrderId

Each location will then have a different key even when the SalesOrderId is the same, i..e. the SalesOrderId becomes "HQ"+"000425" while the salesmans is "SM"+000425"

I hope this helps

regards

issah

von issah - am 18.05.2010 18:04
Issah's answer is great, but if you cannot use that solution there are a couple of alternatives off the top of my head.

The SalesOrderID is not populated when in 'remote' mode on the salesmans laptop. When the replication takes place have the host auto-increment and populate the SalesOrderID.

Or when the salesman goes on the road run a process that reserves a set number of SalesOrderID's for the saleman to use. That way the order has SalesOrderID numbers. When the salesman checks in the orders it unlocks the remaining IDs on the host so they can be used.

What WD does automatically I have no idea. I don't know if the host will reject them as duplicates or not... I would hope so, as the ID's are supposed to be unique.

von Art Bonds - am 18.05.2010 22:33
Hi Reg

PCSOFT does the following

The master's ID start from 1 and the first Subscriber starts at

IDAUTOMin=1000000000
IDAUTOMax=2000000000

That means that all records created by Subscriber starts with the min value for each data base and it will then be managed by WD automatically

Regards
Marius

von MvdW - am 19.05.2010 06:05
Hi Marius,

Thanks for the answer, it seemed likely that PCSOFT would have solved the issue somehow. Despite some people not liking the idea I use AutoID's on every table, not to show the users but to provide an easy, consistent way of retrieving a unique record (no issue with different data types etc) and also to provide foreign key links between tables (e.g Sales Order Header --> Sales Order Lines), so this this was an important thing for me to clarify.

Thanks to everyone else for answering - it's much appreciated :)

Rgds
Reg

von SolutionJ-Reg - am 19.05.2010 06:21
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.