Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

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 for Job Posting

  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.
  5. From the Available Fields section, select:
    1. Job Posting Site: Site Name
    2. Job Posting Site: Status
    3. 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 arrow next 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:
    1. Position: Status
    2. 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 icon to open the App Launcher, then click Recruiting.
    Recruiting app displaying standard tabs and the new Job Posting Sites tab.
  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 Job Posting Sites tab, then New, and enter the details.

    Field

    Value

    Site Name

    Jobs-R-Us

    Job Posting Site URL

    www.jobsrus.com

    Status

    Active

  5. Click Save.
  6. On the Job Posting Site record you just created, click the Related tab.
  7. On the Job Postings related list, click New. For Position, search for and select Super Sales Rep and click Save.

Lots-O-Jobs site with associated Super Sales Rep job posting.

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.

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback