You definitely won’t be able to do that client-side, the Duplicate Button is purely focused on that Entity and will only duplicate those records, not any child records.
One way you would achieve your requirement is through a Customization with Developer Studio basically doing the following:
- Create a new Command (button) at shift level called something like “Duplicate with Breaks”
- Make that command open a dialog (or assistant, but that’s a bit overkill) where you get the user to put in the new updated values from the duplicated (for example a different employee ID, or a different shift start/shift end)
- Once the values have been provided by user, have the command call a newly created Projection Action with a PLSQL Implementation, sending all the data from both the source row (in order to identify any existing children) and the user-specified data (in order to create the new header with new data)
- Have the PL/SQL Method run your business logic (a: Create the new shift header with the values provided by the user, b: check if the source row has any breaks, c: Create the breaks (if they exist) for the newly created shift header