|
|
|
CDML-
Detecting Record Modification Collisions Between Browser Clients
Record Modification
Collision Detection:
In earlier versions of the FileMaker Pro Web Companion there was no easy
means of determining if a record currently loaded in one client browser’s
window had been modified by another client since the time it was loaded
by the first. Submitting an edited record back to the Web Companion enabled
database would overwrite that record, even if it had been modified by
another client since the time it was loaded by the first client.
A new replacement tag, value tag, and error code have been added to the
version 5 Web Companion so record modification collisions can be detected.
The FMP-CurrentModID tag is replaced with an internal modification id
of a given record.
The -ModID tag is an optional tag that can be combined with the -Edit
action request and is ignored in any other action request. The value is
the modification id, which has to match the one in the actual record before
the -Edit action can completed successfully.
If the database record’s internal modification ID has changed since the
client loaded the record in their browser, a new error code (306) will
be returned when submitting a change to that record. If there is no -ModID
tag included in the request with the -Edit action, then the -Edit action
will work as it did in all previous versions of Web Companion.
Syntax Example:
<FORM ACTION="FMPro" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="-DB" VALUE="names.fp3">
<INPUT TYPE="HIDDEN" NAME ="-Format" VALUE ="results.htm">
<INPUT TYPE="HIDDEN" NAME ="-RecID" VALUE ="[FMP-CurrentRecID]">
<INPUT TYPE="HIDDEN" NAME ="-ModID" VALUE ="[FMP-CurrentModID]">
<INPUT TYPE="TEXT" NAME ="Country">
<INPUT TYPE="SUBMIT" NAME ="-Edit" VALUE ="Edit
This Record">
</FORM>
When a browser client submits an edited record in the example above, the
record’s internal modification ID will be compared to the -ModID of the
record when it was first loaded by the client. If the two ID’s are the
same, the -edit action will succeed, if the ID’s don’t match, error 306
will be returned.
Many enhancements and new CDML tags have been
added to the FileMaker Pro Web Companion version 5. Click
here for the .PDF File
|