Hi!
I found many posts about filtering a lookup but none of them fullfilled my needs.
I have three Entities outcome, result and reason.
I have created one Entity which acts as matrix and which has one lookup to each of the entities mentioned before.
So the matrix would look like this (grid with outcome, result and reason):
a | b | c |
a | bb | c |
aa | bb | c |
aa | bbb | cc |
On another entity I have also three lookups one for each entity.
What I want to achieve is: if I select in outcome-lookup the value a I only want to show in result-lookup value b and bb, but not bbb
If I select aa the result-lookup should show bb and bbb but not b.
I've created a view on result, based on related entity matrix where outcome-id eq 'xx'
My filter looks like this:
var outComeCode = Xrm.Page.getAttribute('new_outcomeid').getValue();
var fetchXml = '<filter type="and"><condition attribute="new_outcome" operator="eq" uitype="new_outComeCode" value="' + outComeCode[0].id + '" /></filter>';
var LookupControl = Xrm.Page.getControl("new_resultcode");
if (LookupControl != null) {
LookupControl.addPreSearch(function () {
LookupControl.addCustomFilter(fetchXml);
});
}
but new_outcome is only a attribute of the matrix but not of my result-entity
How can I filter this?
I hope my question is clear and also I hope for a clear and helpful answer
thx
©a-x-i