| View previous topic :: View next topic |
| Author |
Message |
anders_ahlgren
Joined: 28 Mar 2008 Posts: 3
|
Posted: Fri Mar 28, 2008 5:08 pm Post subject: Cascading lookup in custom fields |
|
|
Is it possible to make scripted cascading lookup? For example, I have implemented a custom field "Customer" with a lookup script accessing a database to find the list of customers to put on the drop-down. It works fine.
However, I also want a "Contact" field which should have a drop-down with the contact persons relevant for the selected customer.
I have tried to implement this with a lookup script which pulls the "Customer" from the task, but it works only partially. If I enter a customer in the "Customer" field, save the task, and edit it, then the "Contact" dropdown gets the proper alternatives. However, when creating a new task the "Contact" list is of course initially empty, since there isn't any "Customer" selected. Problem is that when I do select a customer , then the contact dropdown isn't updated. It seems to use the last saved values for the task or, perhaps more likely, it runs the lookup script only before editing is started, not when dropping down the list or such.
Is there any way to solve this?
/Anders |
|
| Back to top |
|
 |
trackman
Joined: 23 Jul 2007 Posts: 56 Location: Cheltenham
|
Posted: Fri Mar 28, 2008 6:30 pm Post subject: |
|
|
Seems that the user would have to do something to get the page to refresh once the "Customer" value has been selected but if the "Contact" value was blank.
You might try a Create Task/INSTEAD OF script that would return an error if the "Contact value" was blank (thereby refresing the page and hopefully populating that dropdown) and otherwise save the task as entered.
It would be interesting to hear if this works! |
|
| Back to top |
|
 |
anders_ahlgren
Joined: 28 Mar 2008 Posts: 3
|
Posted: Fri Mar 28, 2008 7:11 pm Post subject: |
|
|
An interesting idea (although it wouldn't exactly be ideal to have to try to save to get a refresh...), but it doesn't work, unfortunately. The dropdown isn't refreshed after showing the error.
Any other ideas?
/Anders |
|
| Back to top |
|
 |
admin Site Admin

Joined: 01 Jan 1970 Posts: 4362 Location: Smolensk, Russia
|
Posted: Sat Mar 29, 2008 3:08 pm Post subject: |
|
|
| anders_ahlgren wrote: | An interesting idea (although it wouldn't exactly be ideal to have to try to save to get a refresh...), but it doesn't work, unfortunately. The dropdown isn't refreshed after showing the error.
Any other ideas?
/Anders |
The only idea I have - store customer and contact in the single field like:
Customer A / John
Customer A / Bill
Customer C / John
In this case you will select both customer and contact. _________________ Maxim Kramarenko (mailto: maximkr@trackstudio.com)
TrackStudio - Hierarchical Bug & Issue Tracking Software
http://www.trackstudio.com |
|
| Back to top |
|
 |
anders_ahlgren
Joined: 28 Mar 2008 Posts: 3
|
Posted: Mon Mar 31, 2008 10:22 am Post subject: |
|
|
Yes, I was afraid that would be the only answer.
Thanks,
Anders |
|
| Back to top |
|
 |
|