| Stonefield Query SDK |
| Versioning |
Versioning starts with the Version properties of tables, fields, and relationships. A blank value means the object is not versioned: it appears in Stonefield Query regardless of the version of the database. For an object that isn't available in every version of the database, enter the version number followed by "+" to indicate the object appears in that version and higher versions and should not appear in lower versions (that is, the object was added in that version), "-" to indicate the object appears in that version and lower versions and should not appear in higher versions (that is, the object was removed in the next version), or no suffix to indicate the object appears only in that version and should not appear in any other version. For example, "5.3+" indicates the object is available starting in version 5.3 while "5.3-" indicates it was removed in version 5.4.
The next step is telling Stonefield Query which version a particular table, field, or relationship is in the user's selected database. You do this by creating a DataEngine.GetObjectVersion script. This script is passed three parameters: a reference to the SQApplication object, the name of the data object, and the type ("table," "field," or relation"). The code for this script should determine what version the specified object is in the user's selected database and return that version number as a string. The reason this script is called for individual tables, fields, and relations rather than the database as a whole is that some applications have different versions for different objects. For example, someone may be using Version 5.5 of the Accounts Receivable module but version 5.4 of the General Ledger. If your application doesn't have separate version information for different data objects but just one for the entire database, you can disregard the last two parameters passed to the script and just determine and return the version number for the database. See the DataEngine.GetObjectVersion topic for some sample scripts.
Here's how this works: when the user opens a database (either when Stonefield Query starts or by selecting the Open Database function in the File menu), Stonefield Query loads the data dictionary. Once that's done, it then goes through all objects in the data dictionary that have a non-blank Version property, calls DataEngine.GetObjectVersion for each one, and compares the two versions. It removes the object from the in-memory (not on-disk) copy of the data dictionary if:
Thus users cannot select tables and fields that don't exist in their selected database when they create a report.
| Last Updated: 04/17/2009 |