Skip to main content
Question

Is ti possible to autopopulate territory based on state field?

  • October 17, 2017
  • 0 replies
  • 124 views

Good day evreyone, 

We have divided the country in 4 geographical territories for our sales people, we want whenever we fill the state field automatically fill the territory, is it possible?

someone can help? 

ex. State= Jalisco then Territory= Occidente, State=Oaxaca then Territory= Sureste, and so on.

Thank you
This topic has been closed for replies.

  • Registered
  • October 17, 2017
You will need to have a "State" table and a "Territory" table.

Make the Key field on the "State" table be the state.  And related them together so each Territory may have many States.

Also make the relationship that each State has many "Clients" (assuming your 3rd table is Client, or customer).

Then you can make that "State to Client" relationship a formula-text reference field, that looks at the "Address: State/Region" field.

Thus anytime you add an address that has a state and it matches your "States" table, you can automatically have the Territory populated. (passed via Lookups from Territory -> State -> Client)

Side note: I do this in about 30% of the apps I build, and I usually go as granular as zip code for defining territories.

  • Registered
  • October 17, 2017
You can do this without any extra tables if you use script and may well obtain a better solution if the States and Territories do not change frequently (they don't).

I assume your Territories are not political subdivisions but rather groupings assigned by marketing/sales. Would you mind posting your 4 subdivisions for the 31 states for Mexico?

(1) Chihuahua
(2) Sonora
(3) Coahuila
(4) Durango
(5) Oaxaca
(6) Tamaulipas
(7) Jalisco
(8) Zacatecas
(9) Baja California Sur
(10) Chiapas
(11) Veracruz
(12) Baja California
(13) Nuevo Le�n
(14) Guerrero
(15) San Luis Potos�
(16) Michoac�n
(17) Campeche
(18) Sinaloa
(19) Quintana Roo
(20) Yucat�n
(21) Puebla
(22) Guanajuato
(23) Nayarit
(24) Tabasco
(25) M�xico
(26) Hidalgo
(27) Quer�taro
(28) Colima
(29) Aguascalientes
(30) Morelos
(31) Tlaxcala

  • Author
  • Registered
  • October 18, 2017
Thank you for your answers,  exactly there are not political subdivisions, sorry I mistake there are no 4 but 7

1. Bajio
2.Centro
3. Noroeste
4. Noreste
5. Occidente
6. Oriente
7. Sureste

  • Registered
  • October 18, 2017
States And Regions ~ Add New Record
https://haversineconsulting.quickbase.com/db/bm6zr9qak?a=nwr

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=609

Notes:

(1) The States and Regions are unlikely to change short of a new government forming or a change in your Sales Regions so there may not be any good reason to store the State or Region data in one or more related tables. Doing so will just crowd up your application with superfluous fields and tables.

(2) Using table relationships would coerce historic data to map to new states or regions when this probably is not the desired behavior.

(3) This is a very generic solution that can be adopted to any type of lookup scenario.