In Designer mode
The first requirement that you will implement is that register records must be generated with the same date as the date of the document. In other words, let us synchronize the register records date with the document date.
- Create the BeforeWrite client event handler for the document form and add the following script to this handler (listing 21.1).
Listing 21.1. BeforeWrite event handler of the document form
For Each RegisterRecord In Object.RegisterRecords.BalanceOfMaterials Do RegisterRecord.Period = Object.Date; EndDo;