0

I've searched for this everywhere but not found anything explaining how so far. I'd like to create calculated fields in like the age of a person, or have a currency field which is a cumulative of several other fields within the same object.

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Dark Star1
  • 6,986
  • 16
  • 73
  • 121

1 Answers1

1

You have different options to do this:

1) you can create a view and calculate the fields. Within a view you can use group-by and function to calculate min, max, sum, avg, count and others. You can refer to the following link for more informations : http://ofbiz.apache.org/docs/entity.html#View_Entity_Modeling

2) if you are using the domain driven architecture provided by opentaps you can add some code into the repository. The repository works as an abstraction to the data layer allowing you to create calculations and operations before returning the object to the caller

3) You can create a sql with the entity engine and get the calculated fields from the database.

Alberto

integratingweb
  • 146
  • 1
  • 3
  • Thanks I had just arrived at this part in the ofbiz dev book. I'm new to Domain driven architecture paradigm and currently reading through the opensourcestrategies site to understand it. – Dark Star1 Mar 03 '13 at 11:50