On your Listing Object you can find a few out-of-the-box Listing Agent fields. These are typically used with listings published to portals but can also be used with your custom website. These fields can be individually populated on each listing each time you create (edit) a listing.
However, you may want to define the Listing Agent with an automation to reduce necessary manual input and to control what is in those fields. Since you cannot use Cross-Object Formulas (as explained here) directly for this, you need to use an automation
To achieve this, you can create a Flow that updates the Listing Agent fields when the record owner changes to use their information. The following is a basic example, of course you can amend this to your own requirements like hard-coding an email address, the phone number or use other fields to identify which agent is in charge.
- Go to Setup > Flows
- Check if there is an existing flow called "Listing: Update Listing Agent Info" in your ORG already, if not
- Create a new Record-Triggered Flow
- Find the "Listing" object and set conditions when this should run. If you are not sure yet what defines your criteria, try these here which will run the Flow when the listing record owner changes or whenever no first or last name for Listing Agent is present (set everything as in screenshot):
- After closing the last dialogue, you need to add the action it should perform. To do that click the "plus" symbol and choose "Update Triggering Record"
- Then provide a descriptive name (label) for your action like "Update Listing Agent Information"
Consider adding a description so other admins understand the use of the action
Keep "Use the listing record that triggered the flow"
- Still on the same dialogue, set filter conditions next. Click on "Add Condition" to add one condition.
Note: we are checking initially (step 4) to run when the owner changes or there is no first or last name in the corresponding fields.
You can use more conditions here in case you want to be able to overwrite manually, so if no "Last Name" is there (someone removes it) it automatically put back the info based on the current listing owner. This would allow you to enter someone else manually if needed and if desiring to reset to record owner, empty out the last name listing agent field. This is one of the areas you can use own logic to have the Flow work according to your company needs.
- Set the fields to update. To do this, find the fields after clicking on "Add Field" by typing its label:
Add a line for each field you want to update. We concentrated on the most important ones here, but feel free to add more.
The value of each field should be derived from a related record owner "User". Here, too, you can use a different lookup field should you have one (something you may have created like "Marketing Agent (User)"). To get the field you want to map, you have to follow the path of your lookups to the corresponding object's field. In this example we want to map "Listing Agent Website" from a field on the listing record owner (user) record "Website URL":
When done the path looks like this:
And in the end, the entire dialogue should look somewhat like this (note: the screenshot shows an already saved version - click "done" and re-open to edit to see similar view):
- Save your Flow and Activate it.
- Test it on a listing where there is no last name on Listing Agent Last Name or empty it out on a listing. It will update the fields with the record owner's information. If something remains empty, check the record owner's user record. It may not be populated there.
Now, in this example we did a direct lookup of user information that will populate the Listing Agent fields. You can also use hard-coded values on these fields by simply adding the value where you want it hard-coded (losing the dynamic then):
The above is a very basic approach for a Flow. You can do much more with them - way more than with Process Builder. To learn more about Flows, please consider working through this Trail: https://trailhead.salesforce.com/en/content/learn/trails/build-flows-with-flow-builder
And also review Salesforce Help and best-practice using Flows: