Skip to content
Back to Documentation

Install and configure the D365 model

The SIMSTSizeBase model measures how big your tables are and sends the sizes to this portal. This page takes you from an API key to the first snapshot on your dashboard.

What the model does

The model reads the database catalogue of your Dynamics 365 Finance and Operations environment — table names, row counts, and the space taken by data and indexes — and posts it to https://tsize.sims-service.com. It never reads the contents of a table.

On the portal the numbers become a dashboard: what grows, what is safe to clean, and — after a cleanup — how much space you recovered. You can also share the same numbers, anonymously, with engineers who bid on your cleanup job.

Before you start

  • An API key. Create a project in your client dashboard and copy the key shown when it is created. The full key is shown only once — see the Client guide if you have lost it.
  • A D365 user with rights to run it. The model brings the security role Table size administrator (view the data, maintain the setup, run the processes). A system administrator can do all of it too.
  • Outbound HTTPS from the server that runs the batch to https://tsize.sims-service.com, port 443.

Get and deploy the model

SIMSTSizeBase is an X++ model built by SIMS Tech. It is not distributed through a public marketplace yet: write to vhlu@sims-service.com and we will send the package for your environment.

Deploy it like any other custom model: build, deploy the package, then run the database synchronization. Afterwards a Table size folder appears in three places under System administration — Inquiries (to look at the data), Periodic tasks (to run the collection) and Setup (parameters and table groups).

Table size parameters

Open System administrationthenSetupthenTable sizethenTable size parameters and fill the fields below, then save.

Fields of the Table size parameters page
FieldWhat to enterNotes
Portal URLhttps://tsize.sims-service.comOnly the base address. The model adds the path itself.
API keyThe key of your project, starting with sk_Paste it exactly, without spaces before or after.
Minimum recordsFor example 1000Tables with fewer rows than this are not measured. Keep it the same between a before and an after snapshot.
Collect fromThe earliest date to collect data forUsed for the historical series.
Send daily seriesNo, to begin withTurn on later if you want the day-by-day chart. See the optional step below.
Send window (days)90 is a sensible valueHow many recent days of the daily series are sent. Empty or 0 sends the whole series, which grows without limit.

Do not add /api/statistics to the Portal URL

The model appends /api/statistics itself. If you paste the full endpoint, the request goes to /api/statistics/api/statistics and the portal answers HTTP 404.

There is no time zone setting

A statistics day always follows the time zone of your company (legal entity), never the preferred time zone of whoever runs the batch, so the daily chart lines up with your own calendar and does not shift between users.

Send your first snapshot

Open System administrationthenPeriodic tasksthenTable size and run the three tasks in this order:

  1. Update table registry. Refreshes the list of tracked tables and the total database size. Run it once now and again after you add modules.
  2. Collect size snapshot. Measures the tracked tables and stores one row per table. In the dialog, Update mode is one of:
    • Yesterday only — refreshes the previous day; the recommended daily run.
    • Full recollection — re-measures every tracked table now. Use it for the first run.
    • Date range — re-measures the days you choose (From date, To date).
  3. Send size snapshot to portal. Sends the most recent snapshot. In the dialog, Snapshot label says why it was taken:
    • Periodic — a routine measurement. Use this for your first test.
    • Before cleanup and After cleanup — send the first one just before you clean, the second right after. The portal pairs them and shows Space recovered.

When the send finishes, the infolog shows Snapshot chunk 1 of N sent, HTTP 200. Open your project on the portal — the tables appear within seconds. A large database is sent in several chunks of up to 2000 tables; the snapshot counts as complete when the last chunk is in.

Optional: the daily series

The daily series turns your measurements into one point per table per day. Days without a measurement are estimated between the two nearest real ones, and the portal draws those estimated stretches dashed so a guess is never shown as a measurement. To use it, set Send daily series to Yes in the parameters, then run Build daily size series (fields Rebuild from and Rebuild until; leave both empty to rebuild everything; Send to portal when finished sends it straight away) and, separately if you like, Send daily series to portal.

Run it every night

Each of these tasks is a standard D365 batch-capable dialog. In the dialog, open Run in the background, turn on Batch processing, and set a Recurrence.

A typical setup that needs no attention afterwards:

Suggested nightly batch schedule
TimeTaskSetting
02:00Collect size snapshotUpdate mode: Yesterday only, daily
03:00Send size snapshot to portalSnapshot label: Periodic, daily

Leave an hour between them so the collection is finished before the send starts. Before and after a cleanup, run the send by hand with the matching label.

What is sent, and what is not

For every measured table, one row:

One table in the upload
{
  "tableName": "BatchJobHistory",
  "recordCount": 1500000,
  "dataSizeMB": 245.5,
  "indexSizeMB": 89.2,
  "totalSizeMB": 334.7,
  "dataAgeMonths": 36
}
  • tableName is the table name. A table outside the dbo schema is sent as schema.Table, so two tables with the same name in different schemas stay two tables.
  • dataAgeMonths is the age of the oldest row, and is sent only for tables that have a creation date field.
  • Never sent: the contents of any table, user or customer data, company names, server names.

Keep a table out of the upload

The name of a custom table can reveal which product or module you run. Open System administrationthenInquiriesthenTable sizethenTable sizes, select the table and switch on Exclude from collection. An excluded table is not measured and is never uploaded — even if an older snapshot already contains it.

Reading the infolog, fixing errors

Messages you will see while sending, and what they mean:

Infolog messages
MessageMeaning
Snapshot chunk N of M sent, HTTP 200The chunk was accepted. Success.
The portal is throttling (HTTP 429). Waiting … s, then attempt 2 of 5.The portal asked the model to slow down. It waits and retries on its own, up to five attempts.
Enter the portal URL and the API key in Table size parameters before sending.One of the two fields is empty.
No snapshots yet. Run Update table registry, then Collect size snapshot.There is nothing to send yet. Run the first two tasks.
Sending the snapshot failed with HTTP N.The portal refused the request. See the table below.
HTTP status codes and their fixes
HTTPCauseWhat to do
400The payload was not valid.Rare. It usually means the model is much older than the portal — ask us for the current version.
401The key is wrong, mistyped, or has been revoked.Check the API key field for stray spaces. On the portal, open the project: the last upload attempt names the reason. Create a new key if needed.
403The project is paused.Resume the project in your dashboard.
404The Portal URL is wrong.Use only https://tsize.sims-service.com, without /api/statistics.
429The portal is rate limiting.Nothing. The model waits and retries. If it still fails after five attempts, run the send again in a few minutes.
5xxA problem on the portal side.Try again a little later. Uploads are safe to repeat — resending the same snapshot does not create a second one.

HTTP 200, but no “Space recovered”

The portal compares a before and an after snapshot only if they cover roughly the same tables (within 10 %). If you changed Minimum records or excluded tables between the two, the comparison is refused and the reason appears on your project page. Keep the setup unchanged between before and after, then send the after snapshot again.

Still stuck? Write to vhlu@sims-service.com with the infolog text.