How to create a Custom Type
Custom Types enable you to create your own type in Linx by defining its' structure. These are typically complex types, types that consist of a variety of other types and sub-types.
Add a Custom Type
- Click Custom Type on the toolbar
- From the Preoperties section, open the Properties Editor [...] to add the fields for the Custom Type.
- For each field, enter the field's Name, select the Type (e.g. String, Integer, List, etc), and add an optional Value.
- Click the Save button
A simple Custom Type
An example of a simple Custom Type is the one shown in the screenshot below, called 'Article'. It consists of various String-type fields (author, publish_date, summary, and title).
A complex Custom Type
An example of a complex Custom Type is shown below, called 'Article_List'. This Custom Type consists of one field ('Articles'), but this field is referencing another Custom Type (called 'Article', which is the one from the example above for a simple Custom Type) that contains a set of fields. The fields that are contained in the Custom Type that is being referenced ('Article'), now also becomes part of the complex Custom Type ('Article_List').
A custom type might be a 'Customer'. Such a customer would probably have properties like Name, Address and a list of purchases. When you create this type, you will want to specify that the type has a string field called 'Name', another string field with an address and a list of purchases. A purchase is also a type and you will need to create it first. It may consist of a purchase date, an amount and a product. So, you will also need to create a purchase type with a date type called 'purchase date', a decimal called 'purchase amount' and a string called 'Product Name'. You have now created a complex type for storing a customer and all related purchases.
When you point this type at a database query result that has the same fields, you can get Linx to automatically populate the complex type directly from your SQL query.