June 29, 2011 3 Comments
Reference is the way a field or column is presented to the User. For the list of references supported by Openbravo, refer here. These are mainly bundled inside the WAD. I have presented a basic overview of few references that could be of more use.
This reference is used when we want to represent currency values. Different countries will have different currency representations. For instance, Indian representation of currency will have two decimal places. This can be configured in format.xml file. Once this is configured, the decimal places will be globally affected for all the amount fields.
Price and Amount references are almost same. Only difference is we cannot give the minimum and maximum range for the field when it is Price References.
DateTime reference is used to capture the time in hh:mm:ss format. The validation for hours,minutes and seconds are already done in the reference.
ID refers to the primary key field of the Table. This is set up by Openbravo. It uses the Tablename_ID notation to find out what is the primary key for the table.
Images are saved in the AD_Image table in Openbravo. You can refer to the Images saved there, as a dropdown field here. i.e only the name of the image will come in the dropdown.
When you want to display an image in a field, this datatype is used. For more information on setting Images in Openbravo, refer here. The images will be displayed as follows.
The Link reference is used when you want to refer to an external link from Openbravo, or to any link within Openbravo. You can navigate to the link using the button provided at the end of the field.
Presents a list of predefined values as a dropdown. This list can be configured in the Reference Window using the System Administrator role.
TableDir is the abbreviation for TableDirect. In essence, it points out to the foreign key referenced here. For eg., if you refer a field called ad_image_id, Openbravo identifies by itself that there is a table by the name ad_image and pulls all the values of that table and provides as a dropdown in this field. The values that appears in the dropdown is the field that was set as identifier in that Table. Note that, the field name has to be the exact primary column name of the referenced table. There is a small issue with regards to this, which is discussed here.
Table reference is similar to TableDir, but here the name of the referenced field need not be the same as the corresponding ID field of the referred Table. Also in some cases using Table references allows us to add extra filtering conditions to the column. A table reference created for Client is provided below. Even this is configured in the reference window using the System Administrator role.
Would be happy to hear comments and questions.