NS Design System
v3.0.0 · 257 tokens

03Elements

The styled content primitives. Put .ns-prose on any reading surface — a lesson body, a blog post, CMS output — and the bare elements inside it (headings, lists, blockquotes, code, tables…) render in the system's voice with no further classes.

The reading surface — everything below is bare HTML inside .ns-prose

Working with objects

Everything in Salesforce is a record on an object — master this and the rest of the platform follows.

An object is a table with superpowers. Standard objects like Account ship with the org; custom objects end in __c and belong to you.

The rules that matter

  • One object per real-world concept — resist the mega-object
  • Relationships over duplicate fields
    • Lookup when parents are optional
    • Master-detail when the child cannot exist alone
  • Name fields for the reader, not the API

Deploy in three steps

  1. Create the object in a sandbox
  2. Add it to a change set
  3. Validate, then deploy on a quiet Friday morning

The best data model is the one the next admin understands without asking you.

— Every senior architect, eventually

Query it with SOQL — press Cmd Enter to run:

SELECT Id, Name, Industry
FROM Account
WHERE AnnualRevenue > 1000000
ORDER BY Name
Object
A table: Account, Course__c.
Record
A row: one account, one enrolled student.
Field
A column: Name, Level__c, the part you design.

RelationshipChild required?Rollups
LookupNoNo
Master-detailYesYes

Standard and custom objects share the same query language — the skills transfer 1:1.

markup
<div class="ns-prose">
  <h2>Working with objects</h2>
  <p class="ns-lead">Everything in Salesforce is a record on an object — master this and the rest of the platform follows.</p>
  <p>An <a href="#">object</a> is a table with superpowers. Standard objects like <code>Account</code> ship with the org; custom objects end in <code>__c</code> and belong to you.</p>
  <h3>The rules that matter</h3>
  <ul>
    <li>One object per real-world concept — resist the mega-object</li>
    <li>Relationships over duplicate fields
      <ul><li>Lookup when parents are optional</li><li>Master-detail when the child cannot exist alone</li></ul>
    </li>
    <li>Name fields for the reader, not the API</li>
  </ul>
  <h3>Deploy in three steps</h3>
  <ol>
    <li>Create the object in a sandbox</li>
    <li>Add it to a change set</li>
    <li>Validate, then deploy on a quiet Friday morning</li>
  </ol>
  <blockquote>
    <p>The best data model is the one the next admin understands without asking you.</p>
    <footer>— Every senior architect, eventually</footer>
  </blockquote>
  <p>Query it with SOQL — press <kbd>Cmd</kbd> <kbd>Enter</kbd> to run:</p>
  <pre><code>SELECT Id, Name, Industry
FROM Account
WHERE AnnualRevenue &gt; 1000000
ORDER BY Name</code></pre>
  <dl>
    <dt>Object</dt><dd>A table: Account, Course__c.</dd>
    <dt>Record</dt><dd>A row: one account, one enrolled student.</dd>
    <dt>Field</dt><dd>A column: Name, Level__c, <mark>the part you design</mark>.</dd>
  </dl>
  <hr>
  <table>
    <thead><tr><th>Relationship</th><th>Child required?</th><th>Rollups</th></tr></thead>
    <tbody>
      <tr><td>Lookup</td><td>No</td><td>No</td></tr>
      <tr><td>Master-detail</td><td>Yes</td><td>Yes</td></tr>
    </tbody>
  </table>
  <p><small>Standard and custom objects share the same query language — the skills transfer 1:1.</small></p>
</div>

What each element does

  • Headings — Switzer at 700, air above, little below: a heading belongs to what follows
  • Links — brand blue, hairline underline solidifying on hover
  • ul — square markers (sharp geometry, not the default disc); ol — mono numerals
  • blockquote — the 2px brand edge, mono attribution; never an italic wash
  • code / pre / kbd — sunken chips and card-framed blocks in the mono face
  • dl — mono terms, hairline-edged definitions
  • table / hr — hairlines only, mono headers
  • img / figure — card frame, mono caption below (see Image for the full component)