Skip to content
The code you type is not the code that is stored — transcript

The code you type is not the code that is stored — transcript

Presentation 2 of 5 in Customers, suppliers and staff are one record · about 12 minutes · for the whole-system operator — you run the books.

Play this as a presentation — one slide per step, with the same narration. Every word of every step is on this page.

This lesson is for whoever at GadgetSphere imports or keys master data and has searched for a code that is definitely there and definitely not found. In about twelve minutes you will know what the platform does to a code between your keyboard and the database, when it writes one for you, and why some of your customers have none at all.

Step 1 — Type a code and watch it change

After this step you will know that this field is not stored as typed. Every customer, supplier, employee and merchant code goes through the same three operations before it is written: it is upper-cased, the leading and trailing blanks are trimmed, and then every remaining space inside it is removed. Type gadgetsphere kv01 and the record holds GADGETSPHEREKV01. This runs on create and it runs again on every update, so a code cannot drift back. Nothing on the screen tells you it happened; you simply see a different value the next time you open the record.

Screen: Customer Maintenance, the create form, with the Code box holding a value typed in lower case with a space

Reference: Customer Maintenance — Create customer — Main

Step 2 — Leave it blank and get one, once

After this step you will know how a code arrives when you do not supply one. Leave the box empty and the backend mints a code for each flag that is set, from that type’s own running number with the tenant’s prefix in front of it. There are two conditions and both matter. It happens only when the status is something other than TEMP, so a half-finished stub never consumes a number. And it happens only while the stored code is still blank — once a record has a code, no later save will replace it, whatever you clear on the screen.

Reference: Customer Maintenance — Create customer — Main

Step 3 — Expect gaps in the numbering

After this step you will stop treating these numbers as a sequence you can audit. Before a generated code is accepted, the backend checks that no other record already holds it. If one does — because somebody typed that value by hand years ago — it walks forward until it finds a free one and then advances the counter by the whole distance it travelled. So the numbers are unique, they are broadly increasing, and they are not contiguous. A missing number is not a deleted customer. If you need a gapless series for an auditor, this field is not it.

Reference: Customer Maintenance — Create customer — Main

Step 4 — Know what is actually enforced

After this step you will know which duplicate a save will refuse. The code must be unique among records that are not deleted, and a clash is rejected with a named error naming the code. The separate identifier column behind each type is stricter still: the database itself carries a uniqueness constraint on it, so nothing can create a second record with the same one. Deleted records still count when the code is checked, which is why a code you are sure you freed is sometimes still taken. Search the listing with the status filter set to all before you conclude it is available.

Reference: Customer Maintenance — Lifecycle and posting

Step 5 — Read the exceptions in your own data

After this step you will be able to spot records that did not come in through a maintenance screen. Across all ninety tenant databases, seven and a half million codes are upper case with no space, in seventy-nine tenants. Only eight hundred and seventy hold a space, in five tenants, and eighty-two hold lower case, in eleven. Those are the tell: the normaliser cannot produce them, so they were written by something that bypassed it — a migration, a direct load, an older build. Separately, about nine hundred and thirty thousand records carry the customer flag and no code at all, across sixty-one tenants. Those did not come from these screens either.

Reference: Customer Maintenance — Create customer — Main

Step 6 — Decide what to do about it

After this step you will know how to work with the rule instead of against it. If your codes carry meaning, design them without spaces and in capitals, so what you intend is what is stored and your spreadsheets match the platform. If you are searching for a record and failing, search on the normalised form before you search on what you think you typed. And if you need a different code per company — one that your Penang entity uses and your distribution entity does not — that is what the per-company code on Company Linking is for, rather than a second record.

Reference: Supplier — Company Linking

How the steps fit together

    flowchart TD
  s1["Step 1 — Type a code and watch it change"]
  s2["Step 2 — Leave it blank and get one, once"]
  s3["Step 3 — Expect gaps in the numbering"]
  s4["Step 4 — Know what is actually enforced"]
  s5["Step 5 — Read the exceptions in your own data"]
  s6["Step 6 — Decide what to do about it"]
  s1 --> s2
  s2 --> s3
  s3 --> s4
  s4 --> s5
  s5 --> s6
  

Check yourself

Three to five questions on what you just heard. Every correct answer links to the page that makes it correct, so you can check the source, not just the mark.

1. You type `kv 01 north` into the Code box and save. What is stored?


2. A record is created and left at status `TEMP` with the code box empty. What code does it get?


3. Your generated customer codes jump from one number to another with gaps. Why?


4. You find a handful of codes in your tenant containing lower-case letters. What does that tell you?


Answer key
  1. `KV01NORTH` — upper-cased, trimmed, and every internal space removedCustomer Maintenance — Create customer — Main
  2. None — allocation is skipped while the status is `TEMP`, and happens on the save that sets a real statusCustomer Maintenance — Create customer — Main
  3. A candidate number was already taken by a hand-typed code, so the counter was advanced past itCustomer Maintenance — Create customer — Main
  4. They were written by a path that bypassed the maintenance screens, because the normaliser cannot produce themCustomer Maintenance — Create customer — Main
This is a self-check. Your answers are marked in your browser and stay there — nothing is sent anywhere, nothing is recorded, and the marking is readable in the page source, so it is not a credential. Open the answer key at any time.

Next: One record, one control account, decided once · Back to the series · Play this as a presentation

Last updated on