NOT Selected Problem....

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
customaware
Posts: 2403
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

NOT Selected Problem....

Post by customaware »

This has been done before but cannot get it to work.....

I have a BO called Employee.
That BO has a Peer Many of Employees called Friends. pm_Friends (type Employee)

When as an Employee I want to add New Friends, I can do it by Add Reference or PICK Query.

Either way I only want to see Employees that are not already in my Employee.pm_Friends reference attribute.

So assuming the Employee in question is in Context as This Employee (or LoggedInEmployee) I expected this to work

FIND Employee WHERE COUNT Employee WHERE(Employee IN ThisEmployee.pm_Friends )=0

Or

FIND Employee WHERE COUNT Employee WHERE(Employee IN LoggedInEmployee.pm_Friends)=0

Neither works....

Am I missing something?

I have tried all manner of CONTAINS, EXISTS, NOT (EXISITS) etc .... no go.

Any ideas would be appreciated.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Jaymer
Posts: 2451
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: NOT Selected Problem....

Post by Jaymer »

Find employee where employee not in ThisEmployee.pm_Friends
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
customaware
Posts: 2403
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: NOT Selected Problem....

Post by customaware »

Hehee...

I wish.....

Not that simple....

FIND Employee WHERE NOT(Employee IN ThisEmployee.pm_Friends) - Does not Work... Throws Error
FIND Employee WHERE Employee NOT IN ThisEmployee.pm_Friends - Does not Work... Will not even save
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
BLOMASKY
Posts: 1473
Joined: Wed Sep 30, 2015 10:08 pm
Location: Ocala FL

Re: NOT Selected Problem....

Post by BLOMASKY »

Just Spitballing here...

FIND Employee WHERE NOT EXISTS Employee WHERE (Employee IN Employee.pm_Friends)

Bruce
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Re: NOT Selected Problem....

Post by tford »

I spent a couple hours on this, Mark, and still could not crack it. The challenge is that the Reference list references the BO being searched for in the FIND.

As shown here:
https://www.awareim.com/forum/viewtopic.php?f=4&t=5274
when there are two different BOs involved, this syntax works.

#13 of Appendix B - Known Bugs and Limitations helped guide my 2012 post referenced above.
Tom - V8.8 build 3137 - MySql / PostGres
customaware
Posts: 2403
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: NOT Selected Problem....

Post by customaware »

BLOMASKY wrote:Just Spitballing here...

FIND Employee WHERE NOT EXISTS Employee WHERE (Employee IN Employee.pm_Friends)

Bruce
No Cigar Bruce. ;-)
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
customaware
Posts: 2403
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: NOT Selected Problem....

Post by customaware »

tford wrote:I spent a couple hours on this, Mark, and still could not crack it. The challenge is that the Reference list references the BO being searched for in the FIND.

As shown here:
https://www.awareim.com/forum/viewtopic.php?f=4&t=5274
when there are two different BOs involved, this syntax works.

#13 of Appendix B - Known Bugs and Limitations helped guide my 2012 post referenced above.
Yes Tom.... It seems that is correct.

Annoying that the most obvious and logical use of the syntax is the one that does not work.

Dang! :-/
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Rennur
Posts: 1191
Joined: Thu Mar 01, 2012 5:13 am
Location: Sydney, Australia

Re: NOT Selected Problem....

Post by Rennur »

Maybe:
FIND Employee WHERE Employee=LoggedInEmploee AND NOT(EXISTS Friends WHERE (Employee IN Friends.Employee))
Last edited by Rennur on Mon Jun 15, 2020 10:58 pm, edited 1 time in total.
PointsWell
Posts: 1458
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: NOT Selected Problem....

Post by PointsWell »

tford wrote:I spent a couple hours on this, Mark, and still could not crack it. The challenge is that the Reference list references the BO being searched for in the FIND.

As shown here:
https://www.awareim.com/forum/viewtopic.php?f=4&t=5274
when there are two different BOs involved, this syntax works.

#13 of Appendix B - Known Bugs and Limitations helped guide my 2012 post referenced above.
In the absence of a script that works, might a work around be to create a BOG with one member Employee to do the search against?

From a design point of view I have limited all of my pm relationships to be separate BOs to allow for better auditing of what happens to a record, as a pm list only shows a state at a point in time. This has the added benefit that you are rarely searching recursive relationships. Obviously that is a non trivial fix to an annoying problem.
customaware
Posts: 2403
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: NOT Selected Problem....

Post by customaware »

Hi Sean,

Intra has already suggested that and unfortunately it does not work. :-(
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
swiftinitpvtltd
Posts: 370
Joined: Sat Apr 28, 2018 3:33 am
Location: India
Contact:

Re: NOT Selected Problem....

Post by swiftinitpvtltd »

is it possible to add friended-with attribute where when incontext employee adds new friend that users friended-with gets added with this incontext employee.

and then write for incontext employee
FIND Employee WHERE WHERE NOT(LoggedInEmployee IN Employee.friended-with)

I have attached sample working bsv that let employee add new friend and he does see others already added in added list and remaining in not added list. Add new employee and then add friends.
Attachments
samplefriends.zip
(36.81 KiB) Downloaded 459 times
customaware
Posts: 2403
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: NOT Selected Problem....

Post by customaware »

Amit..... couple of things....

The only reason I am doing this is that I WAS using the Swap Select but I am concerned about it.... I think there is some obscure problem with it.
On some occasions - and have yet to be able to replicate the circumstances - all of the selected Items disappear.
Working with Support to nail it down and we thought it was only when the Swap Select was on a Sub Form Tab which has been fixed.... But, it is still
intermittently happening.

So... because I need a working solution and cannot wait .... I removed the SS and have tried using a Reference Query with Add Reference and have also tried via a Process using PICK
Each of these scenarios MUST be able to find Item NOT included.

So, to your solution....

FIND Employee WHERE WHERE NOT(LoggedInEmployee IN Employee.friended-with) does not work. Aware cannot handle consecutive WHERE WHERE
Removing one of the WHERE also does not work

Your sample just uses a Swap Select which is unsatisfactory as per my explanation above.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
swiftinitpvtltd
Posts: 370
Joined: Sat Apr 28, 2018 3:33 am
Location: India
Contact:

Re: NOT Selected Problem....

Post by swiftinitpvtltd »

I have tried all manner of CONTAINS, EXISTS, NOT (EXISITS) etc .... no go.
You are absolutely right on this.
I have fixed it using another way and its working fine. Please run emps query.

and regarding swapselect you may be right as I may have seen similar issue long time back but have not seen it in current projects where I am using it. This may be because of some filter as its bulk select.
Attachments
samplefriendsv1.zip
(39.53 KiB) Downloaded 441 times
Post Reply