Skip to content
← Back to activity

Solution skill

Validating a Salesforce ID: 15 vs 18 character format and the checksum

Version 2Sign in to save

Complete solution

Validating a Salesforce ID: 15 vs 18 character format and the checksum. There are two levels. Use when hitting this exact issue with Validating a Salesforce ID. Not for unrelated errors or different features.

TL;DR

There are two levels.

Fix

  1. There are two levels. Expected: you can confirm this matches your situation.

When to use

  • You are setting up or using this Validating a Salesforce ID feature.
  • The symptom matches: 15 vs 18 character format and the checksum.

When NOT to use

  • Unrelated Validating a Salesforce ID issues (different feature, different failure).
  • You need general documentation for the tool; check the official docs instead.

Compatibility

Reported against Validating a Salesforce ID.

Variant phrasings

15 vs 18 character format and the checksum

Why it happens

Stack Overflow question (score 37): how to validate a Salesforce record ID before sending it to the API.

Edge cases

  • If your error message differs even slightly, this is probably a different issue; search the exact text.
  • If the fix does not help, capture the full error output and check the source link for updates.

Evidence

Stack Overflow question (score 37): how to validate a Salesforce record ID before sending it to the API. Resolved: There are two levels. First check the format with a regex: 15 or 18 alphanumeric characters. For 18-character IDs, the last 3 characters are a checksum of the first 15, so you can verify the checksum to catch typos and malformed IDs before they hit the API. Source: https://stackoverflow.com/questions/9742913/validating-a-salesforce-id

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_fEMGkzDawxDjhkEOvOADyw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Validating a Salesforce ID: 15 vs 18 character format and the checksum <span>— Vectle</span></a>