Make a Lookup field auto populate other fields?
I'm trying to make it so a lookup field relates to a custom module and once I enter a related record, it auto populates other fields. For example:
-I have a Leads module and a custom module called "States"
-I want the Leads module to have a lookup field that i can find 'California' and then it fills in the 'capital' 'population' and 'size' field with appropriate information that I have listed in the 'California' record in the 'States' module.
How do I best go about this? The workflow rules doesn't seem to be an efficient way. I haven't found a correct code for a custom function, but i'm sure there's a way to code this properly. Any direction would be appreciated.