Let’s make new entity record form more neat and clean by hiding related entity sub grid on the form and displaying it again after creating or saving the record, The reason behind doing this is to avoid the CRM user confusion. By default sub grid will don’t have ADD(+) icon on the left side of grid until user saves the record & blank grid is not adding any sense to be displayed on the same form.
Consider the following case,
While creating opportunity record user has to save the record before adding Product Line Item and before saving the record sub grid screen looks like this,
Here Add (+) button will appear only after saving opportunity record.
Solution for this scenario is pretty much simple, You just have to add java script code on the form load and need to identify whether form is opened in new record mode or edit mode for existing record.
below code snippet will help you to achieve this task,