I got a DataObject with some has_many Relations. I know, that the DataObject has to be saved first, before you can add the related Object with a Gridfield (like you have to save first before you can add Images with a Uploadfield).
My Question is, if I can hide the Gridfield and/or the Tab where my Gridfield is in until the DataObject is saved. So that the Editor doesn't get confused.
How does the UploadField work, which first shows a message and after saving the Dataobject shows the possibility to Upload?
I'm pretty sure as of 3.1.x creating a new DataObject creates a draft object so you can actual do relations before saving at least for images. I wrap the fields I want to hide in if $this->ID != 0 since the draft object actually has an ID of 0.