I need to find all "attachment" (A) records that are not referenced by an "activitymimeattachment" (AMA) record. If these 2 records are related, the Id of the A record is stored in the "attachmentid" attribute of the AMA record.
I can find all As that ARE referenced by an AMA with this query:
QueryExpression BLOBQuery = new QueryExpression("attachment");
LinkEntity link = new LinkEntity("attachment", "activitymimeattachment", "attachmentid", "attachmentid", JoinOperator.Inner);
BLOBQuery.LinkEntities.Add(link);
and grouping, selecting first to get unique results based on Id
Is the opposite possible with any crm query mechanism? Linking seems to be irrelevant as it's anti-linking I want...
I can iterate thru all my A's and check if each one is referenced or not but I have a lot of them and it could run for at least a day.