Hi all,
I am working on this file: custom/modules/Opportunities/clients/base/views/record/record.js
When saving the opportunity the handleSave: function (options) function is called. This works.
In this function I am trying to get the data from a related Subpanel and then do some stuff.
e.g.:
console.log(this.model._relatedCollections.contacts);
However, if the subpanel is collapsed, the data of this relatedCollection (in this case: Contacts) is empty.
If the subpanel is expanded, it works fine.
Do you have any idea how I always can get the related data?
On my search I found this, but the related data is only available, if i press the save button two times:
var linkName = 'contacts';
var subpanelCollection = this.model.getRelatedCollection(linkName);
this.model.getRelatedCollection(linkName).fetch({relate: true});
Many thanks for your help