Need help onchange client script :auto populate Technical assessor based on Location on change form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2024 03:41 AM - edited 11-15-2024 03:43 AM
Hi Community,
I have a requirement.
There are two fields on the change form:
- Location (referencing cmn_location, List type) and locations accessor is available on cmn_location referring to sys_user table type is List.
- Technical Assessor (referencing sys_user, List type)
On the Location table, there is a reference field for Technical Assessor, which also points to the User table (List type).
Each location can have one or more technical assessors (stored on the Location table). For example:
- London - Technical Assessor: "abc xyz" or "abc abc"..etc
I would like the Technical Assessor field to auto-populate on change form, based on the selected location(s). There could be multiple locations selected.
If a location has a technical assessor, it should be added. If a location does not have a technical assessor, it should not be added. If a new location is added and it has a value, the value should be appended, If the 'Technical Assessor' field already contains a value, it should not be overwritten. When removing a location, only the technical assessor associated with that location should be removed, while the remaining assessors should stay intact.
Need help on scripting or any ideas will be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2024 05:04 AM
Hi Varsha,
What you have here seems logical enough, but I have one question. Can the user updating the form add a Technical Assessor manually? Reason I ask that is if "John" is Technical Assessor for London, but someone added John manually as a Technical Assessor, saves the form. Then the user comes back and updates the form and add London as a location. That is fine as John is already on the list. However, if the user comes back a second time and removes London from the location, should John be removed? As John was added manually the first time before the location was added. Now this only matters if the user can manually add a Technical Assessor to the list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2024 09:24 AM
@Joe Wong Thank you for your reply, yes Technical Assessor can be added manually as well, and for all the locations Technical Assessor is not available right now, so yes can be added manually even the user is not mapped to any location as Technical Assessor.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2024 12:06 AM
Hi @Joe Wong ,@Anil Lande , @Ankur Bawiskar @Community Alums Need Any help or ideas on this.