Pieces of Advice and Tips
First and foremost, the most important advice is to read the Documentation. It is really helpful for solving initial doubts before starting the development, and specific ones while developing some new functionality.
It is also important to check the Release Notes in order to keep updated with the new developments at Openbravo. It is the only way to know which new technologies have been implemented and take advantage of them.
The Documentation in Openbravo is quite extense, so here are some helpful links:
- Developers Guide
- List of How To's
- How to Set up Eclipse
- Tips and Tricks
- And always, by searching in Google 'wiki openbravo anyting desired to find' it is quite easy to get the correct page for the wiki. For example 'wiki openbravo how to process definition'
- In SQL, avoid using the column_id IN (SELECT ...) clause and use EXISTS instead.
For example, this query:
SELECT COALESCE(Sum(quantity), 0) INTO vresqty FROM m_reservation_stock WHERE releasedqty = 0 AND m_reservation_id IN (SELECT m_reservation_id FROM m_reservation WHERE m_product_id = vmproductid AND isactive = 'Y') AND m_locator_id = v_locatorid AND m_attributesetinstance_id = vattributsetinstanceid
Should be like this:
SELECT COALESCE(Sum(quantity), 0) INTO vresqty FROM m_reservation_stock rs WHERE releasedqty = 0 AND EXISTS (SELECT m_reservation_id FROM m_reservation WHERE m_reservation_id=rs.m_reservation_id AND isactive = 'Y' AND m_product_id = vmproductid) AND m_locator_id = v_locatorid AND m_attributesetinstance_id = vattributsetinstanceid
By doing it, performance improves greatly.
- Never hardcode anything. It makes development harder when extending or modifying functionality. Don't do things like:
VclientID VARCHAR(32):='187D8FC945A5481CB41B3EE767F80DBB' ad_org_id=Vorgid AND name LIKE 'Saleable%'
- When codding PL/SQL is very important to folllow this guide. Following it we will avoid surprises when ant export.database is done.
- When new tables are defined in the application dictionary, the name of the table shouldn't contain spaces.
- When a column is referencing to another table, this column must have a foreign key constrait