Autopoulate Field Based on Lookup Field

Autopoulate Field Based on Lookup Field

I created a custom module:

Module:CustomModule5
API Name:CustomModule5
Displayed as:

SIC Codes  (Plural Form)

SIC Code  (Singular Form)


It contains 2 fields that I care about:

SIC Code
Single Line

SIC Name
Single Line

I'm trying to set this up in the Leads module so that I have a Lookup field for the SIC Code that is pulled from the above  and then a second field (SIC Description) is auto-populated based on the corresponding descruption from the SIC Codes module.

I know I need a custom function but I haven't been able to get it right.

Does anyone have some code they throw my way?

Thanks.

Also, I found this:

https://help.zoho.com/portal/en/community/topic/how-to-auto-populate-based-on-previous-field-entry-from-linked-lookup

I'm guessing I could adapt that somehow?