Refresh records completeness¶
Note
Reference Entities feature is only available for the Enterprise Edition.
Usecases¶
Let’s say we have some records having a value for each of those attributes:
1 attribute of type Single Option
1 attribute of type Multiple Option
1 attribute of type Reference entity single link
1 attribute of type Reference entity multiple links
Whenever an option is removed from the Option (or Option collection) attribute, the records having the deleted option have to be refreshed in order to correctly compute the completeness.
The same operation needs to happen if a record referenced by another record (through a Reference entity single link or Reference entity multiple links attribute) is deleted. All the records referencing the deleted record needs to be refreshed.
Note
The record’s data coming out of the API will always be accurate, yet filtering on the records’ completeness may be de-synchronised.
Command line¶
To achieve this result, you can use the command:
$ php bin/console --env=prod akeneo:reference-entity:refresh-records
This command will go over all the records of the database and refresh all the record’s values.
It is advised to program a crontab to run at least every day when the users are not using the PIM.
Depending on your reference entities’ size (number of records and number of attributes option, option collection, record link and record multiple link) you can run this command multiple times a day.
Note
There are chances this command will be deprecated in 3.1 as we may be able to find a solution to refresh the records directly after an option or record deletion.
Found a typo or a hole in the documentation and feel like contributing?
Join us on Github!