How do I initialize fields in a modal form?

I have a modal dialog, which contains a form.  In the main screen's preparation, if there is no project data to show on the screen, I pop up the dialog to get values from the user.  I want to initialize the form with information that I do know - I have a couple of assignments Eg. 

ProjectForm.Record.Project.CustomerId = CustomerId

However, when the dialog appears, the fields have not been set correctly.

I tried debugging, and the assign is correctly executed - but when the dialog appears, the fields have been reset again.

Can someone let me know what I'm doing wrong?

I've managed to resolve this.  Instead of assigning values to the Form, I assigned values to the current record - even though no record was read.  The values now show on the modal dialog


Hi Ben Gundry,

I reproduced the behavior and managed to initialize the form by creating an entity type variable and assigning the aggregate or assigning a value to one of the fields, for example.