AndrewFry
6 years agoQrew Assistant Captain
Bring down list of available contacts based upon selected client
I have a tried to get this right and keep running into a few issues. I was hoping to get an additional brain or two to look at this.
I have the following tables:
I also have a number of drop downs for the various contact types.
Once I select the Client, the contact type drop downs are selectable, and only show a list of contacts from the client previously selected, matching the contact type for that field, i.e. Home Owner, Manufacturer, Supervisor, etc.
It works great.
However, I now need to have a single contact dropdown in my Assignments form. It will list all contacts, regardless of type, for the client selected in the related work order.
I thought I had figured it out but it isn't working.
I brought the Related Client down from Work Orders through Jobs to Assignments.
I created a Relationship between Assignments and Contacts (Contacts < Assignments).
I made the Assignment's Contacts dropdown be conditional based upon the Job - Work Order - Related Client.
I start a new work order, I selected the client, I click "Add Job" from within the work order form.
It saves the work order and then opens the Add Job form.
I go to the Assignments Grid Edit within the Add Job form to add a corresponding contact to the Assignment.
I get an error message indicating that I first need to select a Job - Work Order - Related Client.
There is a Job - Work Order - Related Client column in the grid edit, but it is not selectable, and gives an error of: This is a lookup field.
Interestingly, I never added that Job - Work Order - Related Client field to the grid edit. It auto-added, and my attempts at removing it visually have been unsuccessful. I am assuming that it is present due to the Assignments' contact field being reliant upon the conditional factor set and related to the Job - Work Order - Related Client.
However, if I save the job, then go back in and edit it, the assignment now has a number in the Job - Work Order - Related Client and will allow me to select from all related contacts for that client.
So I think there is something broken with how I have it set up, in that it isn't pushing the related client from the work order through the job to the assignment, even though the work order gets saved with a client selected before accessing the "Add Job" from. It only updates once I save the job.
I really am at a loss on how to fix this. I have been tinkering but can't seem to get it right. I feel like I am very close, but am missing a key aspect to correctly fix it.
Any input anyone can give is greatly appreciated and will help to nudge, push, or throw me in the right direction.
Oh,. and also, thanks for reading my novel.
------------------------------
Andrew
------------------------------
I have the following tables:
- Work Orders
- Clients
- Contacts
- Jobs
- Assignments
- Clients < Work Orders
- Clients < Contacts
- Contacts < Work Orders (x7, one for each contact type)
- Work Orders < Jobs
- Jobs < Assignments
I also have a number of drop downs for the various contact types.
Once I select the Client, the contact type drop downs are selectable, and only show a list of contacts from the client previously selected, matching the contact type for that field, i.e. Home Owner, Manufacturer, Supervisor, etc.
It works great.
However, I now need to have a single contact dropdown in my Assignments form. It will list all contacts, regardless of type, for the client selected in the related work order.
I thought I had figured it out but it isn't working.
I brought the Related Client down from Work Orders through Jobs to Assignments.
I created a Relationship between Assignments and Contacts (Contacts < Assignments).
I made the Assignment's Contacts dropdown be conditional based upon the Job - Work Order - Related Client.
I start a new work order, I selected the client, I click "Add Job" from within the work order form.
It saves the work order and then opens the Add Job form.
I go to the Assignments Grid Edit within the Add Job form to add a corresponding contact to the Assignment.
I get an error message indicating that I first need to select a Job - Work Order - Related Client.
There is a Job - Work Order - Related Client column in the grid edit, but it is not selectable, and gives an error of: This is a lookup field.
Interestingly, I never added that Job - Work Order - Related Client field to the grid edit. It auto-added, and my attempts at removing it visually have been unsuccessful. I am assuming that it is present due to the Assignments' contact field being reliant upon the conditional factor set and related to the Job - Work Order - Related Client.
However, if I save the job, then go back in and edit it, the assignment now has a number in the Job - Work Order - Related Client and will allow me to select from all related contacts for that client.
So I think there is something broken with how I have it set up, in that it isn't pushing the related client from the work order through the job to the assignment, even though the work order gets saved with a client selected before accessing the "Add Job" from. It only updates once I save the job.
I really am at a loss on how to fix this. I have been tinkering but can't seem to get it right. I feel like I am very close, but am missing a key aspect to correctly fix it.
Any input anyone can give is greatly appreciated and will help to nudge, push, or throw me in the right direction.
Oh,. and also, thanks for reading my novel.
------------------------------
Andrew
------------------------------