Populate dropdown with records from a related module

I have a module called "States" which contains 51 records of data for the US states. I now need to have data for ZIP codes, which I'm thinking of storing in a module called "ZIP codes" with a One (state) to Many (zip codes) relationship. Is it possible to create a dropdown field populated with the States records and a second dropdown populated to the related ZIP code records, based on the State selected.

The data in the selected ZIP code record will then be used in a mathematical calculation.

We have SugarCRM Professional on demand 

Parents Reply
  • You don't need to access directories for Andre's solution, and I'm on Premise so I did my coding in the directory itself but you should be able to develop the code on your local development instance and package it to upload it to the cloud - sorry, I'm not familiar with cloud since I've been working on-site for over a decade.

    It sounds like you might just need to store the zip codes for the exceptions to your insurance premiums, which sounds a lot less daunting than all US Zip Codes ;) 

    If you don't have a ton of Zip codes you could possibly get away with dropdowns.

    I use Dependent Dropdowns for country codes and US States/ Canadian Provinces and I've hardly had to change anything in 10 years.

    You could use Dependent Dropdowns for US States and Exception Zip Codes. Though I can see how that might be a problem in that you would need to maintain those from the Admin panel rather than an interface for your Data Entry people...

Children