I am trying to populate a drop-down list with members of a team so the user can choose a specific name within that team, if desired. If the field is left blank, it will go to everyone on the team and someone from that team will have to grab the task from the “Available” bucket. This would help to match the assignment to a specific person yet still allow management of the roles to drive the options available (e.g., delegation).
FYI, the "HIDDEN FIELD" items in the images will be hidden in the future. Just need to see them to ensure what I'm doing is working.
I have five disciplines: Drafting, Nuclear, QA, Structural, Thermal (ignore "Other" ... that works differently).
- I set up a DB view which links the tables: cf_users, teams, and team_members.
- I set up the Lookups, which work fine ... manually.
- User clicks a checkbox (Drafting and Design, for example). See image below.
- Based on the checkbox, the discipline team (to be hidden in future) fills in with the team name for that discipline through javascript (example: Drafting Team fills in with Drafting and Design).
- User clicks in the discipline field and receives a drop-down of active users within that team.
Here's my problem ... the field filled in via javascript is not recognized in the Lookup. See "Drafting", above. I thought maybe I needed a delay, that didn't work.
Manually, this works great! I know because when I click in the discipline Team field, delete out what's there, choose the Team name again, I get the drop-down list I'm expecting and can assign to an individual!!! See "Structural", above.
Here's the javascript:
$(document).ready(function(){ //Teams Fill Based on What's Checked $(".dcrReviewList").change(function () { if ($("input[id^=Field169-0]").is(':checked')){ $('.draftingTeam input').val("Drafting and Design"); } else{ $('.draftingTeam input').val(""); } if ($("input[id^=Field169-1]").is(':checked')){ $('.nuclearTeam input').val("Nuclear Analysis"); } else{ $('.nuclearTeam input').val(""); } if ($("input[id^=Field169-2]").is(':checked')){ $('.qaTeam input').val("QA Project Support"); } else{ $('.qaTeam input').val(""); } if ($("input[id^=Field169-3]").is(':checked')){ $('.structuralTeam input').val("Structural Analysis"); } else{ $('.structuralTeam input').val(""); } if ($("input[id^=Field169-4]").is(':checked')){ $('.thermalTeam input').val("Thermal Analysis"); } else{ $('.thermalTeam input').val(""); } }); }); //close document.ready
Maybe someone has a better solution/design? If so, please share.