Create a Self Relationship with the Position Object
Create a Lookup Relationship
When members of Ling Wu’s HR team are looking at a position in their recruiting app, she would like each recruiter to be able to identify other open positions that require similar skills or have similar job descriptions. This will allow recruiters to more easily determine appropriate roles for candidates.
You can set this up for her by creating a lookup relationship. Lookup relationships link two objects together. You can link an object with another standard or custom object, or you can link an object with itself—that’s called a self relationship.
Start by creating a self relationship with the Position object.
- From Setup, click Object Manager.
- Click Position.
- Click Fields & Relationships, then New.
- Select Lookup Relationship as the Data Type.
- Click Next.
- In the Related To picklist, select Position.
- Click Next.
- Change the Field Label to
Related Position
. - Change the Field Name to
Related_Position
. - Click Next, Next, and Next.
- Change the Related List Label to
Related Positions
. - Click Save.
Add Lookup Filters
Now add lookup filters by department and record ID, to help recruiters narrow their searches.
- Click next to Related Position and select Edit.
- In the Lookup Filter section, click Show Filter Settings.
- Click and select Related Position from the first column, Department from the second column, and click Insert.
- For Operator, select equals.
- For Value/Field, select Field.
- Click and select Current Record: Position, then select Position: Department.
Now fill in the next row of filter criteria.
- Click and select Position from the first column, Record ID from the second column, and click Insert.
- For Operator, select not equal to.
- For Value/Field, select Field.
- Click and select Current Lookup: Related Position, then select Related Position: Record ID.
- For Filter Type, ensure Required is selected.
- For If it doesn’t, display this error message on save, enter
The related position must be in the same department. You cannot relate a position to itself
. - Click Save.
Now let’s test what you’ve just done by viewing a position in the Recruiting App.
- Click to open the App Launcher, then click Recruiting.
- Click Positions, then New, then enter the details of the new position.
Field Value Title Awesome Sales Rep Department Sales Approval Status Approved Location US Job Description Sales rep to join the AW Computing team serving the western region of AMER - Click the Related Position field and select Super Sales Rep.
- Click Save.
- Notice that Super Sales Rep appears as a related position for Awesome Sales Rep. (You may need to refresh the page.)
Using relationships and filters, you’ve enabled recruiters to work more efficiently. Keep up the good work by creating custom fields.