Key field cannot be blank

I got this error:

Key field “Demand ID” cannot be blank when adding a new record in a form. I’m using the “ref” column type here, and I ticked the “is part of” checkbox. The initial value of the demand id is blank since I wait to fetch the value of the demand ID of the parent table. Please help. I used the same approach to another app, but I didn’t encounter the error.