Hi all,
I'm trying to create a custom button in a form subgrid that copies the data from one of the columns.
It'd be easy if the property I want to copy was from the directly-related entity, but in my case, the column comes from a level below (linked to the related entity), so it's not listed on the row.getData().getEntity().attributes.getAll();
@Edit: Example
So here I have a view on the Contact form showing the associated Accounts.
The second column is a lookup field of the entity for its parent account.
The third column is the email address of its parent account. That is the value I want.
I created a ribbon button for this subgrid passing the SelectedControl as the parameter, with the following code:
function getEmail(control) { var rows = control.getGrid().getRows(); rows.forEach(function (row, i) { var data = row.getData().getEntity().attributes.getAll(); console.log(data); }); }
But as the log shows, the column with the associated value is not being fetched:
I know that I could fetch the data using REST, but since the data is already being shown in the subgrid, it must be a way to access it without sending another request.
I'm also trying to avoid unsupported solutions, but they are welcome if there's no supported way of doing that.
Any ideas?