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.
Sample BSV: Showing items NOT in a reference list already
Sample BSV: Showing items NOT in a reference list already
Tom - V8.8 build 3137 - MySql / PostGres
Re: Sample BSV: Showing items NOT in a reference list alread
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.
I was reviewing this logic to incorporate it into a new BSV & realized the BSV was no longer linked properly.
Tom - V8.8 build 3137 - MySql / PostGres
Re: Sample BSV: Showing items NOT in a reference list alread
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.
Tom - V8.8 build 3137 - MySql / PostGres
Re: Sample BSV: Showing items NOT in a reference list alread
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:
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:
Tom - V8.8 build 3137 - MySql / PostGres
Re: Sample BSV: Showing items NOT in a reference list alread
One last detail .. I wanted to show a query of first names of users that were watching / not watching a milestone:
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`)
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.8 build 3137 - MySql / PostGres
Re: Sample BSV: Showing items NOT in a reference list alread
Are those really supposed to be "accent marks" instead of single quotes?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`)
... 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.
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
Jaymer
Aware Programming & Consulting - Tampa FL
Re: Sample BSV: Showing items NOT in a reference list alread
Jaymer,
I just verified that rule is copied & pasted from a working BSV.
I just verified that rule is copied & pasted from a working BSV.
Tom - V8.8 build 3137 - MySql / PostGres
Re: Sample BSV: Showing items NOT in a reference list already
Hi all - first post on the forum and relatively new to AwareIM, but loving the forum and the sharing
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
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