Kartris User Guide

14.2. The object config system

Very often when creating new features, you need to set values at the product or version level. We found this ourselves when adding new features to Kartris. Rather than adding new fields in the existing product and version tables, we came up with a better solution - the object config system.

14.2.1. Adding settings

Each new setting required is added as a record to the tblKartrisObjectConfig table in the database. The data type can be string (s), boolean (b) or numeric (n). Once a record has been added here, the new setting is immediately available on the object config tab when editing products. Any values set are stored in the tblKartrisObjectConfigValues table.

There is no Kartris GUI for adding these values; it needs to be done manually within SQL Management Studio. However, it's not something that will be done routinely, and even then only by developers, so it's not something that we'd really want to have a back end page to handle doing anyway.

14.2.2. Reading settings

Of course, as well as setting values, you will also want to read them within whatever new code you write. Fortunately, the functions to support this are already in Kartris. You can call an object config value simply as follows:
Dim strSampleValue As String = ObjectConfigBLL.GetValue("K:product.myobjectname", numProductID)
The numProductID value, which is the database ID of the product (P_ID from the tblKartrisProducts table) is available in some for or another in most places that products are being handled.

You should of course replace K:product.myobjectname with the actual name of your object config setting.
 
powered by tomehost