Hi good people,
I have a model driven app with these main entities:
An Estimate has many Cost Items (1:N).
An Estimate has many Proposal Items (1:N).
A Proposal Item has many Cost Items (1:N)
The Requirement: When selecting a Proposal Item (parent) for a Cost Item (child) - they both have to be children of the same Estimate as well.
I can achieve this easily on the Cost Item form by setting the Proposal Item lookup to "Filter by related rows":
The problem:
I can't find an out-of-the box way to achieve this when selecting multiple Cost Items at once.
I have tried (and failed) to achieve this from both the Cost Item direction (Bulk Edit) and the Proposal Item direction (Add Existing).
Here is the example: The "Expansive" Estimate has 3 Proposal Items, and many Cost Items. I want to associate multiple Cost Items to the "Far Away" Proposal Item:
From the Cost Items direction:
On the Estimate form, I have a sub grid of Cost Items. When the user selects multiple Cost Items and click Edit, the Bulk Edit form opens and shows Proposal Items from all Estimates in the environment, not respecting the "Filter by related rows" setting:
Clicking in the Advanced Lookup button opens the Proposal Item Lookup view, which also contains Proposal Items related to other Estimates as well. The funny part is that you can see the "Filter by related: Estimate" selected and disabled, but, unfortunately, not respected:
Another "Unfortunately" is that the Estimate column in this view is not filterable.
From the Proposal Items direction:
I thought I will be able to tackle this from the Proposal Item side by allowing the users to add multiple cost items to the related item sub grid:
On the Proposal Item form I added a Cost Item sub grid (selecting the "Show related records").
When the user is on a Proposal Item form and clicks the "Add Existing Cost Item", once again they see Cost Items that belong to Estimates other than the one the Proposal Item belongs to ("Expansive", in this case):
Clicking the Advanced Lookup button does not help either, since the Estimate column is, again, not filterable.
I am grateful to everyone who made it this far.
I see some posts on the net suggesting Jscript solutions (like
this one), but they all mention that this is a problem of "filtering N:N lookups", where in my case there are no N:N relationships, as described at the beginning of this post, so maybe there is an out-of-the box solution to this problem?
Thanks for your help,
Gil.