Database Override
Database override allows you to override specific values in the database for the POS. This can be very useful for development or testing as you can inject almost any value. Database override is also helpful when trying new features that might in themselves require a database column to be added. With database override you can spoof this value.
Database override has many restrictions, for example any value provided cannot be searched or found using normal SQL. This means queries will continue to use the stored value not the override value. Overrides primarily exist to provide values for fields that are not normally present and used as reference type information, such as products.sellingmsg or products.sellcondition
Database override is permitted for production use, but should be avoided from heavy use. Specifically, some reports DO NOT detect database override values.
Database override is available from PosGreen P2367
How it Works
In normal operation, rows exist in a database, with values in each column. Consider this product record:
pid | description | UnitPrice | SellCondition |
33 | Chocolate Easter Bunny | 8.95 | easter |
For testing, lets say we want to override the SellCondition from "easter" to "pre-easter" (both fictituous examples). Enter the following values in fpos.ctl
force:StorageLocalData.products.33.sellcondition=pre-easter
The format of the setting to define is
- The word "StorageLocalData". Note, 3 uppercase characters
- The name of the table in lowercase
- The key value of the record.
- The name of the field in lowercase
You can also define values for columns that do not exist in the database. Doing this makes the POS think this field does exist. For example, to define "PrePosCommand" for this record, enter the following in fpos.ctl
force:StorageLocalData.products.33.preposcommand=message(99,1,This product is being overridden)
The net effect of the above two entries in fpos.ctl is to make the product record appear to PosGreen as follows
pid | description | UnitPrice | SellCondition | PrePosCommand |
33 | Chocolate Easter Bunny | 8.95 | pre-easter | message(99,1,This product is being overridden) |