I have a query that starts at the QueueItem and, if the entity that Queue Item references is an E-mail, adds some additional filter conditions. One of those conditions is the primary field value of whatever that e-mail, in turn, is "Regarding". I don't really care what type of entity the E-mail references, I just need to allow the user to filter by the "Name" of that entity. Is this possible, and if so, how?
Asked
Active
Viewed 501 times
0
-
1Allow the user how ? report ? advanced find ? – Alex Oct 28 '15 at 08:34
1 Answers
0
This depends somewhat from where the query is performed from.
With a basic FetchXML query, in around about sort of a way this is possible, you need to do joins on the relationship and see if there is a record there. Its not perfect but it might work.
If you are running the query from code, then its a bit easier as you can examine the entity type in code. For example:
EntityReference e = entity.GetAttributeValue("regardingobjectid");
string entityName = e.LogicalName;

James Wood
- 17,286
- 4
- 46
- 89
-
1
-
Good point, outer joins might help, somewhat hard to say as its not clear what the OPs full usage scenario is, https://msdn.microsoft.com/en-gb/library/dn531006.aspx – James Wood Oct 28 '15 at 10:34