{"title":"Junction objects","slug":"junction-objects","url":"https://support.storeconnect.com/articles/junction-objects","url_markdown":"https://support.storeconnect.com/articles/junction-objects.md","subtitle":null,"summary":"Understand how StoreConnect connects two records that have a many-to-many relationship, how to recognize a junction object by its name and fields, and what that means when you query, import, or delete records.","type":"Developer_Documentation","video_url":"","keywords":"junction object, many-to-many, relationship, lookup, master-detail, salesforce data model, soql, data loader, content blocks pages, products product categories, zone country, join table","last_modified":"2026-08-21T07:12:35+0000","body_markdown":"Salesforce cannot link two records directly in a **many-to-many** relationship,\nwhere each side can have many of the other. A product belongs to several\ncategories, and a category holds several products. One-to-one and one-to-many\nrelationships are a plain lookup field on the record; many-to-many needs a record\nin between.\n\nStoreConnect solves this the standard Salesforce way, with a **junction object**:\na small record in the middle holding a relationship field to each side. If you\nhave come from relational databases, this is the join table you would expect, and\nthe two relationship fields are its foreign keys. Salesforce calls it a junction\nobject, and StoreConnect names these records after the two things they join, so\nthat is the term used here.\n\nUse this article when a relationship you expect to find on an object is not\nthere. Most of the time it is on a junction, one step away.\n\n## Why a content block is not on the page\n\nThe clearest example is the one that surprises people most often. Open the\n[Content Block](content-block-object-reference) object and you will find lookups\nto **Media** and nothing else. There is no **Page** field. Yet content blocks\nplainly appear on pages.\n\nThe link lives on [Content Block Page](content-blocks-pages-object-reference),\nwhich holds two fields:\n\n| Field | Points at |\n|-------|-----------|\n| `s_c__Content_Block_Id__c` | [Content Block](content-block-object-reference) |\n| `s_c__Page_Id__c` | [Page](page-object-reference) |\n\nOne record per block-on-a-page. Put the same block on three pages and you get\nthree of these records, each with its own **Position**, so the same block can sit\nin a different place on each page.\n\nEvery object reference article now has a **Referenced by** section listing the\nrecords that point at it, with an **Also links to** column naming what a join\nrecord connects it to. That is the fastest way to answer \"what is this related\nto?\" for any object.\n\n## Recognizing one\n\nA junction object in StoreConnect usually has all three of these:\n\n- **A name made of the things it joins.** `Product_Tag__c`, `Zone_Country__c`,\n  `Content_Blocks_Pages__c`, `Membership_Article__c`.\n- **A relationship field to each side**, named `\u003cThing\u003e_Id__c`.\n- **Few fields of its own.** Often just **Position** or a quantity, sometimes\n  nothing at all.\n\nNone of those is absolute. Some junctions carry real data: a\n[Fulfillment Item](fulfillment-item-object-reference) records how much of an\norder item a shipment covers. Some join three things rather than two:\n[Promotion 2 Condition](promotion2-condition-object-reference) pairs a condition\nand a reward with a promotion. And some are named for what they represent rather\nthan for both sides, like [Payment Item](payment-item-object-reference).\n\nEqually, an object with two lookups is not automatically a junction. **Address**\npoints at both **Account** and **Contact**, but it is a record in its own right\nwith a street, city, and postcode. The test is purpose, not shape: would the\nrecord still mean anything if you removed the links? For a junction, no.\n\n## Master-detail or lookup\n\nJunctions use both, and the difference matters when you delete something.\n\n- **Master-detail** ties the junction's life to its parent. Delete the parent and\n  the junction records go with it. On\n  [Content Block Page](content-blocks-pages-object-reference), the **Page** side\n  is master-detail, so deleting a page removes its placements, leaving the\n  content blocks themselves untouched.\n- **Lookup** leaves the junction behind. The field simply empties.\n\nCheck the **Relationships** table on the object reference article before you\ndelete anything in bulk. The **Type** column tells you which behavior applies.\n\n## Working with junctions\n\n**Querying.** You cannot reach across a junction in one hop. To list the\ncategories a product belongs to, query the junction and traverse from there:\n\n```sql\n\nSELECT s_c__Category_Id__r.Name\nFROM s_c__Products_Product_Categories__c\nWHERE s_c__Product_Id__c = '01t...'\n```\n\n**Importing.** Create both sides first, then the junction records. A junction\nrow with an unresolved key fails, and master-detail junctions cannot be created\nbefore their master exists at all. Use `s_c__sC_Id__c` external IDs to reference\nrecords you have just loaded rather than looking up Salesforce IDs.\n\n**Counting.** A junction row is one relationship, not one product. Reporting on\n`Products_Product_Categories__c` counts placements; a product in four categories\ncontributes four rows.\n\n## Junction objects in StoreConnect\n\nGrouped by the area they belong to. Each links to its object reference, where the\n**Relationships** and **Referenced by** tables give the field names and types.\n\n### Catalog\n\n| Junction | Joins |\n|----------|-------|\n| [Product Product Category](products-product-categories-object-reference) | Product2 and Product Category |\n| [Product Tag](product-tag-object-reference) | Product2 and Tag |\n| [Product Media](product-media-object-reference) | Product2 and Media |\n| [Product Tax](product-tax-object-reference) | Product2 and Tax |\n| [Product Tax Group](product-tax-group-object-reference) | Product2 and Tax Group |\n| [Product Variant](product-variant-object-reference) | Product2 and Product2, for variant sets |\n| [Related Product](related-product-object-reference) | Product2 and Product2 |\n| [Related Product Category](related-product-category-object-reference) | Product Category and Product Category |\n| [Product Category Hierarchy](product-category-hierarchy-object-reference) | Product Category and Product Category, for nesting |\n| [Account Product Category](account-product-category-object-reference) | Account and Product Category |\n| [Supplier Account](product-supplier-object-reference) | Account and Product2 |\n\n### Content and design\n\n| Junction | Joins |\n|----------|-------|\n| [Content Block Page](content-blocks-pages-object-reference) | Content Block and Page |\n| [Content Block Product](content-blocks-products-object-reference) | Content Block and Product2 |\n| [Content Block Article](content-blocks-articles-object-reference) | Content Block and Article |\n| [Content Block Product Category](content-blocks-product-categories-object-reference) | Content Block and Product Category |\n| [Content Block Child](content-blocks-children-object-reference) | Content Block and Content Block, for nesting |\n| [Articles Article Categories](articles-article-categories-object-reference) | Article and Article Category |\n| [Article Tag](article-tag-object-reference) | Article and Tag |\n| [Page Tag](page-tag-object-reference) | Page and Tag |\n| [Related Article](related-article-object-reference) | Article and Article |\n| [Related Page](related-page-object-reference) | Page and Page |\n\n### Customers and access\n\n| Junction | Joins |\n|----------|-------|\n| [Membership Article](membership-article-object-reference) | Membership and Article |\n| [Membership Page](membership-page-object-reference) | Membership and Page |\n| [Location Group Account](location-group-account-object-reference) | Account and Location Group |\n\n### Shipping zones and geography\n\n| Junction | Joins |\n|----------|-------|\n| [Zone Country](zone-country-object-reference) | Zone and Country |\n| [Zone State](zone-state-object-reference) | Zone and State |\n| [Zone City](zone-city-object-reference) | Zone and City |\n| [Zone Postcode](zone-postcode-object-reference) | Zone and Postcode |\n\nA zone is built from whichever of these four you need. They are separate\njunctions rather than one, because a zone can mix levels: a whole country plus a\nhandful of individual postcodes.\n\n### Fulfillment and inventory\n\n| Junction | Joins |\n|----------|-------|\n| [Product Fulfillment Category](product-fulfillment-category-object-reference) | Product2 and Fulfillment Category |\n| [Fulfillment Category Station](fulfillment-category-station-object-reference) | Fulfillment Category and Fulfillment Station |\n| [Outlet Stock Location](outlet-stock-location-object-reference) | Outlet and Stock Location |\n| [Store Stock Location](store-stock-location-object-reference) | Store and Stock Location |\n| [Product Delivery Window](product-delivery-window-object-reference) | Product2 and Delivery Window |\n| [Fulfillment Item](fulfillment-item-object-reference) | Order Item and Shipment, with an optional Asset |\n| [Cart Fulfillment Item](cart-fulfillment-item-object-reference) | Cart Fulfillment and Cart Item, the pre-order equivalent |\n\n### Orders, payments, and promotions\n\n| Junction | Joins |\n|----------|-------|\n| [Voucher Payment](voucher-payment-object-reference) | Voucher and Payment |\n| [Order Item Reward](order-item-reward-object-reference) | Order Item and Reward |\n| [Cart Promotion 2](cart-promotion2-object-reference) | Cart and Promotion 2 |\n| [Tax Tax Group](tax-tax-group-object-reference) | Tax and Tax Group |\n| [Payment Item](payment-item-object-reference) | Payment and Order Item, so one payment can cover several items |\n| [Allocated Fulfillment Payment](allocated-fulfillment-payment-object-reference) | Fulfillment Item and Payment Item |\n| [Order Item Tax](order-items-taxes-object-reference) | Order Item and Tax |\n| [Promotion 2 Condition](promotion2-condition-object-reference) | Promotion 2 with a Condition and a Reward |\n| [Permitted Restricted Item](permitted-restricted-item-object-reference) | Order Item and Permitted Restricted Product |\n\n### Store configuration and POS\n\n| Junction | Joins |\n|----------|-------|\n| [Store Form](store-form-object-reference) | Store and Form |\n| [Product Form](product-form-object-reference) | Product2 and Form |\n| [Store Campaign](store-campaign-object-reference) | Store and Campaign |\n| [Store Feed](store-feed-object-reference) | Store and Feed |\n| [Product Bookable Location](product-bookable-location-object-reference) | Product2 and Bookable Location |\n| [Register Shift User](register-shift-user-object-reference) | Register Shift and User |\n| [Outlet User](outlet-user-object-reference) | Outlet and User, with the user's Outlet User Type |\n\nYou should now be able to look at any object reference article, see from its\n**Referenced by** table which junctions point at it, and follow the **Also links\nto** column to whatever sits on the other side."}