(Maybe a simple question, or we may overthink this a bit so bear with us..)
We are trying to run query wich will show all objects thas has a certain childobject as undefined.
The childobject is multiple.
We have tried several approached but the best we can come up with is a calculated field which SHOWS the object which HAS somthing in this child object (which is the opposite of what we are trying to do).
Basically we are writing an errand system and we want to show which customer that has no errands, which could indicate that something in wrong, since there should be no customers with 0 errands
Showing objects with empty childobject
Re: Showing objects with empty childobject
FIND Parent_BO WHERE COUNT Child_BO WHERE (Child_BO IN Parent_BO.Childs)=0
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
Re: Showing objects with empty childobject
You can add an attribute to the parent BO to count the children and add a rule to keep that attribute up to date with the number of children.
Use that counter in your query.
I typically use the counter approach as I find that I want to know that info @ multiple times.
Use that counter in your query.
I typically use the counter approach as I find that I want to know that info @ multiple times.
Tom - V8.8 build 3137 - MySql / PostGres
Re: Showing objects with empty childobject
Thanks!
Solved the problem!
Been away for 7 years so have to wrap my head arround this again!
Solved the problem!
Been away for 7 years so have to wrap my head arround this again!
Re: Showing objects with empty childobject
Thanks!weblike wrote:FIND Parent_BO WHERE COUNT Child_BO WHERE (Child_BO IN Parent_BO.Childs)=0
This also helped!