So I have a form from a BO called Consideration. Consideration can have a parent (RootConsideration) and children (pm_BranchConsiderations). I want to be able to select a parent or children that is not:
A) The same consideration as the instance related to my form.
B) Already a child of the consideration.
C) Already a parent of the consideration.
It would be nice if it also looked for grandparents and above as well as grandchildren and below. But that would require nested recursive queries, which I don't believe AIM supports. If you have a solution for that, please share.
For the query, I first tried using the COUNT=0 and NOT (EXISTS) suggestions and got nowhere. Here's one such example that doesn't work reliably:
Code: Select all
FIND Consideration WHERE NOT (EXISTS Consideration WHERE (Consideration IN ThisConsideration.pm_BranchConsiderations)) AND Consideration<>ThisConsideration AND (Consideration<>ThisConsideration.RootConsideration OR ThisConsideration.RootConsideration IS UNDEFINED)
Code: Select all
FIND Consideration WHERE (Consideration.RootConsideration<>ThisConsideration OR Consideration.RootConsideration IS UNDEFINED) AND Consideration<>ThisConsideration AND (Consideration<>ThisConsideration.RootConsideration OR ThisConsideration.RootConsideration IS UNDEFINED)
Another thing that wasn't obvious is the process for picking children, which is this:
Code: Select all
PICK ONE OR MORE FROM PickBranchConsiderations
INSERT OtherConsideration IN ThisConsideration.pm_BranchConsiderations
Hope that was useful!