×
Menu
Index

3.2.4. Data from related tables

 
The data array can have multiple rows in case of a grid, and will have one row to fill a form.
 
In a lot of cases you will have an ID in your database, and you want to show data from another related table.
 
In all these cases you need to define where to get this data. With this information BOA will know how to refresh the data after a search.
 
The below sample if for a product. There is data from 3 related tables:
 
"data": [
{
  "id": "0015119",
  "art_nummer": "PHHD782920     ",
  "art_soort": "O",
  "omschr_e": "PHILIPS SENSEO VIVA CAFE 2 BLUE HD782920",
  "omschr_f": "PHILIPS SENSEO VIVA CAFE 2 BLUE HD782920",
  "nummer": 460,
  "lever_naam": "VAN DE VOORDE BVBA            ",
  "suppliers": {
     "id": "460",
     "number": 460,
     "name": "VAN DE VOORDE BVBA            "
  },
  "ref_lev": "                              ",
  "ean": "8710103814016",
  "familie": "00200 ",
  "subfamilie": "00300 ",
  "cat": "00100 ",
  "subcat": "      ",
  "groepen_omschr": "Electromechanisch                                 ",
  "product_category": {
     "id": "37",
     "familie": "00200 ",
     "subfamilie": "00300 ",
     "cat": "00100 ",
     "subcat": "      ",
     "description": "Electromechanisch                                 "
  },
  "brand": "PHILIPS LAMPEN ",
  "brand_name": "PHILIPS LAMPEN           ",
  "brands": {
     "id": "369",
     "brand": "PHILIPS LAMPEN ",
     "description": "PHILIPS LAMPEN           "
  },
  "eenh": "  ",
  "verpak": 0,
  "netto": 1.100,
  "min": 0,
  "max": 0,
  "hoev": -1,
  "verkocht": 2,
  "res": 3,
  "besteld": 0,
  "vrij": -4,
  "mag": 0.00,
  "consign": 0,
  "verkoopa": 84.94,
  "recyclage": 0.05,
  "bebat": 0.00
}
]
 
The data array for a form has one row.
 
The list of fields contains the data to display in the form after a GET. BOA will display this without any change.
 
In the list there a three separate data objects which defines data from a related table.
  • suppliers
  • product category
  • brand
 
When there are search or searchedit elements on the form, these will also be defined in which table a search must be performed. After a search the content of the corresponding data objects will be updated. Also for all the elements with a data part, the elements will also be filled and refreshed.