There is one query. On Salesforce Docs, you have defined Many to Many relationship between Candidates and Positions Objects using Job Application Object which is not a JUNCTION OBJECT. ( One candidate can apply to many positions and also one position can be applied by many candidates )


But on the other hand, you say that you must create a Junction Object to implement many -to- many relationship.

  • 3
    Why do you think job application is not a junction object? – Adrian Larson Mar 13 '17 at 23:45
  • Conceptually Job Application is a junction object, but in their book "Force.com Platform Fundamentals" they distinguish Job Application and Job Posting objects, describing later as a junction object to represent a many-to-many relationship. This is confusing. I think the book should tell that Job Application and Job Posting are both junction objects for many-to-many relationship, but using Master-Detail or Lookup will provide different behavior, like type of ordinality ("one" with Master-Detail or "zero or one" with Lookup), deleting, sharing settings, related lists, etc. – Eduard Jan 14 '18 at 12:54

A junction object is one that contains two relationship fields, relating two objects (or possibly the same object twice) in a many-to-many relationship. In the Schema Builder, a typical junction object will look like this:

Opportunity Products

Here, Opportunity Product relates Product records to Opportunity records. One Opportunity can have many Products, and one Product may be associated to many Opportunities. In the example documentation, the Job Application links one Applicant to many Positions, and one Position to many Candidates. This is the very definition of a junction object.

In the salesforce.com UI, we only really see two types of objects: "Standard" and "Custom." There is no place in the system where you can explicitly create a third type of object called a "Junction" object. However, these objects may have one or more attributes that may not explicitly be called out by the UI: setup, non-setup, master, detail, sub-detail, parent, child, grandparent, grandchild, junction, and so on.

One single object in Salesforce is rarely of a single type, but will have several properties depending on how it is defined. For example, Opportunity is a child of Account, but a master of Opportunity Product; it is also a standard object.

When you create an object with two lookup fields, and its primary purpose is to relate two other objects together in a many-to-many relationship, you have created a junction object. The UI will not change; it will not suddenly declare that this custom object is now a junction object. It does not matter the junction object is standard or custom. As long as its purpose is to link two other objects together in a many-to-many relationship, it is a junction object.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.