Sample BSV: Showing items NOT in a reference list already

Contains tips for configurators working with Aware IM
Post Reply
tford
Posts: 4210
Joined: Sat Mar 10, 2007 6:44 pm

Sample BSV: Showing items NOT in a reference list already

Post by tford »

Version 5.2 (starting with build 1513) now supports a query displaying items NOT in a reference list already.

This BSV demonstrates the concept:

http://www.awareim.com/community/Not_Query_Demo.bsv

1 ) The rule to for the query to show instances NOT selected (the top query) is:

FIND Customer WHERE COUNT RegularUser WHERE (RegularUser=LoggedInRegularUser AND Customer IN RegularUser.SelectedCustomers)=0 ORDER BY Customer.Name

2 ) Through using Auto Refresh capabilities of the 2 queries, items move "real time" between the selected and not selected lists.

3 ) When combined, these features mitigate the limitation that queries can only apply a process on items selected on one page. While that limitation still is true, the dynamic nature of selecting & moving instances to a selected items query provides some relief.

4 ) Once items are moved to a selected items area, a process can easily be applied to all of the selected items.

To see this BSV in action:

5 ) Click "add new customer" and add some. I suggest adding more than 5 so they continue to page 2 of the query.

6 ) In the top query, click "Select" for some individual instances & watch them be removed from the top query & added to the bottom query

7 ) Now do the same for multiple instances at one time.

8 ) In the bottom query, clicking "flag selected customers" and "unflag selected customers" shows that a process can be applied to all selected items. Not that these processes will apply across ALL pages of the bottom query.

9 ) Click in the top menu bar "review selected customers". This shows one other way of viewing the Customers stored in LoggedInRegularUser BO.

10 ) Click in the top menu bar "remove all selected customers" to more all items back from the bottom query to the top query.
Tom - V8.7 build 3006 - MySql / PostGres
tford
Posts: 4210
Joined: Sat Mar 10, 2007 6:44 pm

Re: Sample BSV: Showing items NOT in a reference list alread

Post by tford »

Attached is a new version of this sample BSV that works with V6.0 / build 2042.

I was reviewing this logic to incorporate it into a new BSV & realized the BSV was no longer linked properly.
Not_Query_Demo.zip
(40.01 KiB) Downloaded 793 times
Tom - V8.7 build 3006 - MySql / PostGres
tford
Posts: 4210
Joined: Sat Mar 10, 2007 6:44 pm

Re: Sample BSV: Showing items NOT in a reference list alread

Post by tford »

Please ignore my earlier post today. The attached BSV better demonstrated the concept. After adding customers & selecting a few, click "Review selected customers" from the main menu bar. When you click "Add", you will be presented with a list of the customers that are NOT in the Customers Selected List so that you can add additional customers to this list.
customers not selected.png
customers not selected.png (31.13 KiB) Viewed 18128 times
Not_Query_Demo.zip
(40.12 KiB) Downloaded 771 times
Tom - V8.7 build 3006 - MySql / PostGres
tford
Posts: 4210
Joined: Sat Mar 10, 2007 6:44 pm

Re: Sample BSV: Showing items NOT in a reference list alread

Post by tford »

One more example query:

FIND RegularUser WHERE COUNT Student_Milestone_Notify WHERE (Student_Milestone_Notify=ThisStudent_Milestone_Notify AND RegularUser IN Student_Milestone_Notify.Users_to_Notify)=0 ORDER BY RegularUser.Name_Last,RegularUser.Name_First

In this case, I have a BO Student_Milestone_Notify with an attribute Users_to_Notify. This reference attribute contains a list of the RegularUser instances that have selected to be notified when additions are made to a particular milestone. The query above is used to show the RegularUser instances that have NOT yet selected to be notified for a particular milestone.

It is called from the "Add" button on Student_Milestone_Notify.Users_to_Notify as shown below:
users to notify.png
users to notify.png (47.65 KiB) Viewed 18126 times
Tom - V8.7 build 3006 - MySql / PostGres
tford
Posts: 4210
Joined: Sat Mar 10, 2007 6:44 pm

Re: Sample BSV: Showing items NOT in a reference list alread

Post by tford »

One last detail .. I wanted to show a query of first names of users that were watching / not watching a milestone:
milestone watch list.png
milestone watch list.png (17.64 KiB) Viewed 18125 times
Below are the two rules used to generate the two lists:

Student_Milestone_Notify.Who_is_not_watching=LIST_LINE('Student Milestone - Users Not Selected',``,`, `,`Name_First`)

Student_Milestone_Notify.Who_is_watching=LIST_LINE('FIND RegularUser WHERE RegularUser IN Student_Milestone_Notify.Users_to_Notify ORDER BY RegularUser.Name_Last',``,`, `,`Name_First`)
Tom - V8.7 build 3006 - MySql / PostGres
Jaymer
Posts: 2189
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Sample BSV: Showing items NOT in a reference list alread

Post by Jaymer »

tford wrote: Student_Milestone_Notify.Who_is_not_watching=LIST_LINE('Student Milestone - Users Not Selected',``,`, `,`Name_First`)

Student_Milestone_Notify.Who_is_watching=LIST_LINE('FIND RegularUser WHERE RegularUser IN Student_Milestone_Notify.Users_to_Notify ORDER BY RegularUser.Name_Last',``,`, `,`Name_First`)
Are those really supposed to be "accent marks" instead of single quotes?
... for the 2-4th parms to LIST_LINE

I know it shows that in the Docs, but I can't get this to work in any case.
I'm trying to use in an UPDATE RULE and it complains:
Recip.theLists = LIST_LINE (Recip.pm_List, 'ORDER BY FName DESC‘,,,'ListName')
I get a Syntax Error at this location.

And I get crap like this when I try to use the accent marks, but if they are regular single quotes. no error.
Screen Shot 2017-11-19 at 4.54.03 PM.png
Screen Shot 2017-11-19 at 4.54.03 PM.png (16.68 KiB) Viewed 17102 times
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
tford
Posts: 4210
Joined: Sat Mar 10, 2007 6:44 pm

Re: Sample BSV: Showing items NOT in a reference list alread

Post by tford »

Jaymer,

I just verified that rule is copied & pasted from a working BSV.
Tom - V8.7 build 3006 - MySql / PostGres
gernotlg
Posts: 8
Joined: Fri Aug 27, 2021 1:24 am

Re: Sample BSV: Showing items NOT in a reference list alread

Post by gernotlg »

tford wrote: Sun Jul 26, 2015 8:05 am Attached is a new version of this sample BSV that works with V6.0 / build 2042.

I was reviewing this logic to incorporate it into a new BSV & realized the BSV was no longer linked properly.

Not_Query_Demo.zip
GOLD !!
Thanks
poshaccy
Posts: 1
Joined: Wed May 11, 2022 11:55 pm

Re: Sample BSV: Showing items NOT in a reference list already

Post by poshaccy »

Hi all - first post on the forum and relatively new to AwareIM, but loving the forum and the sharing :D

Anyway, I've download the BSV from this thread on in July 2015 and I'm looking to incorporate it into my program but would really like to be able to exclude certain records from the original query "Customers Not Selected".

For example;
The current query contains ALL customers, but I would like to exclude inactive customers (with the Customer BO I have an Inactive Yes/No box). I have tried to exclude Inactive Customers by putting a "Matching Criteria" within the query "Customers Not Selected" but they are still included when the query is run.

Is this possible using this method?

Many thanks
Paul
Post Reply