I have a 1:N relationship from EntityA to EntityB, I have plopped a subgrid on the form of EntityA showing all related (1:N) EntityB records.
As usual, there is a "+" button for that subgrid, when clicking it, this shows a textbox with an hourglass to the right. When clicking the hourglass, a drop down deploys, showing all EntityB records. At the end of this list, there's a "New +" button, letting users add a new record.
Since this is a 1:N relationsip, adding an EntityB already linked to another EntityA throws an error saying the record is already associated.
Why is it then not filtering or preventing the ability to select other records then ?
If I can't configure the grid so that when the "+" icon is clicked, it goes straight to create form of EntityB, can I at least filter the dropdown so it shows no record at all and reduce likelyhood of users being confused by showing only the "New +" link ?
I know how to filter for simple lookup fields
Xrm.Page.getControl('new_field').addPreSearch(function () {
Xrm.Page.getControl('new_field').addCustomFilter(fetchXml);
});
But for that dropdown list, I'm at a loss.