Skip to main content

Create a Custom Junction Object for Job Postings

Your next step in improving HR’s recruiting app is to create a junction object called Job Posting. A junction object is a custom object with two master-detail relationships, and it is the key to making a many-to-many relationship.

A job posting fits into the space between positions and employment websites. One position can be posted many times, and one employment website can have many job postings, but a job posting always represents a single position on a single employment website.

In essence, the Job Posting object has a many-to-one relationship with both the Position and the Job Posting Site objects. Through those many-to-one relationships, you create a many-to-many relationship between the Position and Job Posting Site objects.

Create a Custom Junction Object

  1. From Setup, click Object Manager.
  2. Click Create, select Custom Object, and fill in the details.
    Field
    Value
    Label
    Job Posting
    Plural Label
    Job Postings
    Record Name
    Job Posting Number
    Data Type
    Auto Number
    Display Format
    JOBPOST-{0000}
    Starting Number
    1
  3. Leave everything else as is, and click Save.

Next, create the master-detail relationship between Job Posting and Position.

  1. While still viewing Job Posting in Object Manager, click Fields & Relationships, then New.
  2. Select Master-Detail Relationship as the Data Type.
  3. Click Next.
  4. For Related to, select Position.
  5. Click Next.
  6. For Field Label, enter Position.
  7. Click Next, Next, Next and Save & New.

Now fill in the details for a master-detail relationship between Job Posting and Job Posting Site.

  1. Select Master-Detail Relationship as the Data Type.
  2. Click Next.
  3. For Related to, select Job Posting Site.
  4. Click Next.
  5. For Field Label, enter Job Posting Site.
  6. Click Next, Next, Next and Save.

Modify the Page Layouts

Next, add fields to the Job Posting Site related list on the Position page layout.

  1. From Setup, click Object Manager.
  2. Click Position, then Page Layouts.
  3. Click Down arrow next to Position Layout and select Edit.
  4. Scroll down to the Job Postings related list, and click Wrench icon in the header to edit it. Job Postings related list in the Position page layout menu, showing the wrench icon
  5. From the Available Fields section, select
    • Job Posting Site: Status
    • Job Posting Site: Technical Site
  6. Click Add.
  7. From the Selected Fields section, select Job Posting: Job Posting Number and click Remove.
  8. Click OK, then click Save.

Finally, add fields to the Position related list on the Job Posting Site page layout.

  1. From Setup, click Object Manager.
  2. Click Job Posting Site, then Page Layouts.
  3. Click Down arrownnext to Job Posting Site Layout and select Edit.
  4. Scroll down to the Job Postings related list and click Wrench icon in the header to edit it.
  5. From the Available Fields section, select
    • Position: Status
    • Position: Title
  6. Click Add.
  7. From the Selected Fields section, select Job Posting: Job Posting Number and click Remove.
  8. Click OK, then Save.

Now let’s test what you’ve just done by creating a Job Posting record.

  1. Click App Launcher iconto open the App Launcher, then click Recruiting.
  2. Click the Positions tab, then New, then enter the details of the new position.
    Field Value
    Title Super Sales Rep
    Department Sales
    Approval Status Approved
    Location US
    Job Description Sales rep to join the AW Computing team serving the eastern region of AMER
  3. Click Save.
  4. Click the pencil icon at the top right of the screen.
  5. Click Add more Items.
  6. From the menu on the left, click All.
  7. Next to Job Posting Sites, click the +.
  8. Click Add 1 Nav item.
  9. Click Save.
  10. Click the Job Posting Sites tab, then New, then enter the details of the new Job Posting Site.
    Field Value
    Site Name Lots-O-Jobs
    Job Posting Site URL www.Lotsojobs.com
    Status Active
  11. Click Save.

Good work. By creating a junction object and customizing some page layouts, you’re one step closer to getting the job done. Next let’s create a self relationship with Position to help the HR team recruit more efficiently.

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities