Hi,
This is probably entry level but I'm restarting my journey with AwareIM and need to get this straight.
So, imagine that I have a BO called Job.
I also have a BO called Contractor.
In Job I created a ps_Contractors.
Suppose I add 3 of the 10 Contractors that I have in my Contractor list, to my Job.
If I want to add more Contractors to same Job later, I only want to see the Contractors that I haven't added yet.
As it is now, each time I go to add another Contractor from list to my Job, it shows all of the Contractors, including the ones that I had already chosen.
TIA
Only show remaining that weren't picked previously
Only show remaining that weren't picked previously
Regards and thanks,
Harry Carter
Harry Carter
Re: Only show remaining that weren't picked previously
PICK FROM Contractor WHERE Contractor NOT(IN Job.Ps_Contractors)
INSERT Contractor IN Job.ps_Contractors
INSERT Contractor IN Job.ps_Contractors
Rocketman
V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
Re: Only show remaining that weren't picked previously
Or it could be WHERE NOT(Contractor in ….
Rocketman
V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
V8.7 Developer Edition. Server 2016 Standard edition. MySql 5.5
-
- Posts: 1463
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: Only show remaining that weren't picked previously
Negated participation in a list is a known issue.
The solution is
If I can make a suggestion, just using a peer multiple relationship to Contractor will only give you a binary state for the Contractor, i.e. they are on a job or are not on a job. Without knowing anything about your app, if you want to be more involved in how the Contractor participates on a job, e.g. when they were assigned, when they were removed, their starting date/time ending date/time, rate etc. then you probably want to have a full on BO relationship e.g. JobContractor with an JobContractor.obJob and Job.omJobContractor.
The solution is
Code: Select all
FIND Contractor WHERE COUNT Contractor WHERE( Contractor IN Job.pm_Contractor ) = 0
I'm guessing that your Job.psContractor is a multiple and so pmContractorSo, imagine that I have a BO called Job.
I also have a BO called Contractor.
In Job I created a ps_Contractors.
Suppose I add 3 of the 10 Contractors that I have in my Contractor list, to my Job.
If I can make a suggestion, just using a peer multiple relationship to Contractor will only give you a binary state for the Contractor, i.e. they are on a job or are not on a job. Without knowing anything about your app, if you want to be more involved in how the Contractor participates on a job, e.g. when they were assigned, when they were removed, their starting date/time ending date/time, rate etc. then you probably want to have a full on BO relationship e.g. JobContractor with an JobContractor.obJob and Job.omJobContractor.
Re: Only show remaining that weren't picked previously
Thanks Pointswell... but how do I pull from Contractor?PointsWell wrote: ↑Fri Feb 10, 2023 10:28 pm Negated participation in a list is a known issue.
The solution is
Code: Select all
FIND Contractor WHERE COUNT Contractor WHERE( Contractor IN Job.pm_Contractor ) = 0
I'm guessing that your Job.psContractor is a multiple and so pmContractorSo, imagine that I have a BO called Job.
I also have a BO called Contractor.
In Job I created a ps_Contractors.
Suppose I add 3 of the 10 Contractors that I have in my Contractor list, to my Job.
If I can make a suggestion, just using a peer multiple relationship to Contractor will only give you a binary state for the Contractor, i.e. they are on a job or are not on a job. Without knowing anything about your app, if you want to be more involved in how the Contractor participates on a job, e.g. when they were assigned, when they were removed, their starting date/time ending date/time, rate etc. then you probably want to have a full on BO relationship e.g. JobContractor with an JobContractor.obJob and Job.omJobContractor.
Regards and thanks,
Harry Carter
Harry Carter
-
- Posts: 1463
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: Only show remaining that weren't picked previously
Well, so I do as you state but the choices need to come from a BO called Contractor because that will be the master list
JobContractors for Job need to come from a list of Contractors that are always available.
Regards and thanks,
Harry Carter
Harry Carter
-
- Posts: 1463
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: Only show remaining that weren't picked previously
The suggested approach would add another grid to the Job BO.
For example
JobContractor would need
- psContractor - Contractor
- DateStart - Date
- DateEnd - Date
- Rate - Number
Code: Select all
ENTER NEW JobContractor WITH JobContractor.obJob=Job
Code: Select all
FIND Contractor WHERE Count JobContractor WHERE (JobContractor.obJob=Job AND Contractor=JobContractor.psContractor)=0
Re: Only show remaining that weren't picked previously
Getting there but have no idea what the "CODE: SELECT ALL" means and where I would enter that. Are you referring to a rule?PointsWell wrote: ↑Sat Feb 11, 2023 12:34 amThe suggested approach would add another grid to the Job BO.
For example
JobContractor would needWhen adding the JobContractor to Job.omJobContractor use a custom implementation using whatever form you've designed for this purpose and passing in the Job as an input
- psContractor - Contractor
- DateStart - Date
- DateEnd - Date
- Rate - Number
You'd then make JobContractor.psContractor filter asCode: Select all
ENTER NEW JobContractor WITH JobContractor.obJob=Job
Code: Select all
FIND Contractor WHERE Count JobContractor WHERE (JobContractor.obJob=Job AND Contractor=JobContractor.psContractor)=0
I am about as green on this as one can get, lol.
TIA
Regards and thanks,
Harry Carter
Harry Carter
-
- Posts: 1463
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: Only show remaining that weren't picked previously
Code Select All is the forum, if you press that you can then copy the code in the code block. But I don't think my code snippets will be that useful.
Re: Only show remaining that weren't picked previously
Does this help?
https://www.awareim.com/forum/viewtopic ... 674#p45674
A blast form the past. 11 years ago.
https://www.awareim.com/forum/viewtopic ... 674#p45674
A blast form the past. 11 years ago.
Tom - V8.8 build 3137 - MySql / PostGres
Re: Only show remaining that weren't picked previously
HI tford,
I'm not sure.
A better visual:
On left menu, I have General Contractors. Let's say it's a master list of all possible General Contractors that I would use. They don't belong to any job until I choose one or more from that master list.
I have a BO called job. When I click on a job and drill into it, I have tabs. One of these tabs is called "Bids submitted to". Here is where I would have an Add button... and when I clicked Add, the master list of General Contractors (from the left) would appear and I could check 1 or more General Contractors from this list and they would now be the General Contractors for this job only.
I made the relationships but I have a disconnect I think in the "Add" button. I know I have to choose "Reference" but of what? The General Contractors query?
I'm not sure.
A better visual:
On left menu, I have General Contractors. Let's say it's a master list of all possible General Contractors that I would use. They don't belong to any job until I choose one or more from that master list.
I have a BO called job. When I click on a job and drill into it, I have tabs. One of these tabs is called "Bids submitted to". Here is where I would have an Add button... and when I clicked Add, the master list of General Contractors (from the left) would appear and I could check 1 or more General Contractors from this list and they would now be the General Contractors for this job only.
I made the relationships but I have a disconnect I think in the "Add" button. I know I have to choose "Reference" but of what? The General Contractors query?
Regards and thanks,
Harry Carter
Harry Carter
Re: Only show remaining that weren't picked previously
Hi Harry,
Did you unzip the file in that thread and look at how it worked? That may help guide how you approach this.
Did you unzip the file in that thread and look at how it worked? That may help guide how you approach this.
Tom - V8.8 build 3137 - MySql / PostGres
Re: Only show remaining that weren't picked previously
tford,
I didn't see it, sorry.
I just loaded it and will try to wrap my head around it.
I'm a bit primitive at this but I did see that you only had one peer relationship, yet you accomplished the goal.
Dang, I need to learn more...problem is, it always seems that what we need is never quite what is shown in help posts or documentation.
I didn't see it, sorry.
I just loaded it and will try to wrap my head around it.
I'm a bit primitive at this but I did see that you only had one peer relationship, yet you accomplished the goal.
Dang, I need to learn more...problem is, it always seems that what we need is never quite what is shown in help posts or documentation.
Regards and thanks,
Harry Carter
Harry Carter