[SalesForce] Lookup data from a custom object from a formula field

I have a question for you guys. I have a custom Market object that stores the market city and states for Radio campaigns. The problem is when a customer comes on board and purchases air time on the radio, we have to close the market they are in so no conflicts arise. I am creating leads based off of customers expressing interest in the product and I am writing the market to the Lead object when the lead is created.

What I would like to do is keep another field, Market Status, up to date with whether or not the market is closed or open. What I thought I would do is create a formula field that would display the market status in real time based on the Market on the lead. Is this the right way to do this, or even possible to do it this way? I'm an API guy and don't really use the GUI that much, so I am not that familiar with it. If anyone has any better way to do this, your advice is much appreciated. Thanks!

Best Answer

Yes, a formula field is the way to go here. Add a custom field to lead, formula data type, text return type. Select the Advanced Formula Editor, and then click "Insert Field". You should see an item like "Market >" - click that and you can select fields from the Market object. When you find the right field, insert it. You should end up with something like

Market__r.Market_Status__c

If Market Status is a picklist field, you need to wrap the whole thing in a TEXT() for it to work:

TEXT(Market__r.Market_Status__c)