RE: The use of reread() for a table record.
The reread() method in Dynamics 365 Finance and Operations is a table record method that retrieves the latest data for the current record from the database.
When you retrieve a record using the table and tableBuffer methods, you get a copy of the data that is stored in the buffer. The buffer contains a snapshot of the data from the database at the time the record was first retrieved.
If another user or process updates the record in the database while the record is still in the buffer, the buffer will contain outdated data. To ensure that you are working with the latest data from the database, you can use the reread() method to refresh the buffer with the current data from the database.
When you call the reread() method, the system will issue a SQL SELECT statement to retrieve the current version of the record from the database. The buffer will then be updated with the new data.
It's important to note that calling the reread() method will discard any changes made to the record in the buffer since it was first retrieved. Therefore, it's best practice to call the reread() method before making any updates to the record, to ensure that you are working with the latest data.