A120 – Historize a business object
What you will learn ?
Historize a business object
STEP 1: Open the business object to historize
STEP 2: Add the historic object to the diagram
If the historic object does not already exist, the platform will create it.
- Generated name is Historic: it is important not to change it!
- The name of the table will be the same as the main object suffix “_hist”
- The historic object has its generated fields referenced to the father: reference, version, date, login
- And all the attributes of the main object
- And a read right function to grant
It is therefore possible to insert it in the diagram:
- Right click on AppClient / Fetch related Business object
- Or right click on the diagram Insert Business object and select the historical object
- Insert the generated object
AppClientHistoricin the object diagram
- Save the diagram
STEP 3: Configure the historic object
You can configure the historical object like any other object:
- Add function
- Remove or add attributes, except those that deal with technical history:
row_ref_id: foreign key to the father row_idx: incremental version created_by_hist: user created_dt_hist: datetime
- Change the translation by
- Verify that the tab will be visible:
In the object
AppClientLink Tab open
AppClientHistoriccheck that Visible panel is set to Yes.
We could also hide by setting to no but keep the object to save historic data in table.
STEP 6: Change default sorting
- change the default sorting of the field
row_idxto -2, in order that the data are ordered from newest to oldest.
STEP 7: Remove fields from historic object
Generally all the fields are not to “historize” then they should be remove from the object. Pay attention not to remove a field, you need only to delete the object field, not the field itself. If the field is removed, it will also be removed from the main object (as already seen, a field can belong to several objects, it is the case in the historic object).
- Remove the object field related to the customer name in
AppClientHistoric. This means that any change of name will not be historized.
STEP 11: Test the action
Open the object containing the action and check that it performs well what is set.
- Open a customer who has interests
- Check that the total calculation works by clicking on the button
If action is not visible is that the user is not in a group granted to the function of the action.
If the calculation does not work, look out for the logs and fix the code.
Remember to clear the cache at each update.