Showing posts from June 24, 2010

Validations in Openbravo

Validations in openbravo are meant to ease the user's interaction with the system. The most simple example would be, there are two tables c_country and c_region provided in the core module. Now at run time when an user chooses a country he would want the regions of that particular country to be displayed. this is achieved by validations. Validations can be applied to four basic data-types in openbravo.  They are Button, List, TableDir and the Table. Now to add a validation go the validation menu in the Application Dictionary-->Setup. Provide a new name under your module and add your logic in the Validation code column. There are 3 types of validations possible viz, SQL,Java and JavaScript. Lets do the SQL type. now to validate the region all you got to add is "c_region.c_country_id=@c_country_id@" . Now add this in column "c_region_id" in any table that you have used. Now for further insight, the "@" symbol is used to fetch the value of the variab…