Simulate Create New Child record

I have created a customization on the UD100 table and added a button click event to create the Child record.

However when I click the button I receive the following error:

System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Does anyone have an example of how to simulate adding a new child record to a parent record?