When attempting to edit related records of a hosted feature service using the Web AppBuilder for ArcGIS Edit widget, the primary and foreign keys, GlobalID and GUID, are not populated immediately upon creation of a feature, thereby related records added are orphaned.
Related records are not added correctly to new features because the GlobalID field is not populated when the feature is created. After creating a new feature, refresh the browser, which populates the GlobalID field. After ensuring that the GlobalID field is populated for the new feature, follow the editing workflow to add a related record, and the record will not be orphaned.