Inventory SP Data Status¶
New in 5.67.
Inventory usage, turns and months on hand come from the inventory history in each company database. The stored procedure LEAHYCONSULTING.InventoryHistory_DailyUpdate builds it, and a SQL Server Agent job named Pulse Inventory History Daily Update runs that procedure once a day. Report columns showing these figures are shaded cream. When the job stops running, those columns go on showing the last figures it produced.
Settings → Administration → Inventory SP Data Status... shows how old the inventory history is and, when it is out of date, why, with what to do about it. An administrator can also rebuild the history from the screen and put the daily update job back.
When PULSE Dashboard checks¶
PULSE Dashboard checks the inventory history every time it connects to a database. The data counts as out of date after 36 hours without a complete refresh: one daily run, with 12 hours to spare. Every time is read from SQL Server's clock, so a workstation with the wrong date or time zone does not change the answer.
When something needs attention, the Inventory SP Data Status screen opens once PULSE Dashboard has loaded. It opens once per session for each database, and only for users who have the warning switched on.
The status bar¶
The state of the inventory data is shown at the right-hand end of the status bar. The text is red when something needs attention, and clicking it opens the Inventory SP Data Status screen.
| Status bar | Meaning |
|---|---|
| Inventory SP data: refreshed 9 hours ago | The inventory history is up to date. |
| Inventory SP data: refreshing | A refresh is running now. |
| Inventory SP data: 3 days old | The inventory history is out of date. |
| Inventory SP data: will not refresh | The data is still current, but something will stop the next refresh. |
| Inventory SP data: never refreshed | No complete refresh has been recorded. |
| Inventory SP data: not checked | The database could not be read. |
A database without the inventory history installed shows nothing here.
The Inventory SP Data Status screen¶
The screen opens with a short explanation of where the inventory figures come from, and a swatch of the cream shading used for their columns. Below that it says whether the inventory history is up to date and when it was last fully refreshed. Each problem found is listed next, in bold, with its cause and what to do about it. When nothing needs attention the list reads Nothing needs attention.
Three tabs hold the detail:
- Inventory History: the year balances and the monthly details for the newest fiscal year, with the last result of each, when it started and finished, and how long it took.
- Refresh History: this database's step in the job, newest first, with the result, how long it took and SQL Server Agent's message. SQL Server Agent keeps a limited history, 100 rows per job by default, so older runs drop off.
- Diagnostics: everything the check looked at and what it found, including the job's steps and schedules, its next scheduled run, and how long a successful refresh of this database usually takes.
Check Again runs the check again, for example after starting the job by hand.
Refresh Now¶
Refresh Now rebuilds this database's inventory history straight away, the way the daily update does, instead of waiting for the next scheduled run. It works on SQL Server Express too, which has no SQL Server Agent to run the job.
Before it starts, a message lists what it will rebuild, including which fiscal years, and how long building those years took last time when that is recorded. A progress window then shows each step as it runs, with the time spent on it. PULSE Dashboard cannot be used until the refresh finishes.
Cancel stops the refresh once the step in progress ends. The steps already done are kept, and the rest run the next time the inventory history is refreshed. Reports that use the inventory history show the new figures the next time they refresh.
Refresh Now is unavailable while the daily update job is refreshing the same database.
Restore Schedule¶
Restore Schedule is shown when the daily update job has been deleted or disabled, has no enabled schedule, or has no step for this database. It puts the job back the way PULSE Dashboard installs it, scheduled daily at 4:00 AM. A message lists what it will change before anything is changed. Nothing is refreshed at that point; use Refresh Now for that.
Where PULSE Dashboard's own Daily at 4:00 AM schedule is still attached to the job but disabled, it is enabled again rather than duplicated. If one of the changes fails, the changes already made are kept, and the message names what is still missing so a SQL Server administrator can finish the job in SQL Server Management Studio.
Causes it recognizes¶
| What the screen reports | What to do |
|---|---|
| SQL Server Express cannot run the daily update | Express has no SQL Server Agent, so the job never runs. Use Refresh Now to rebuild the inventory history, or move the database to an edition of SQL Server that includes the Agent. |
| SQL Server Agent is not running | Start the Agent in SQL Server Configuration Manager, and set its startup type to Automatic so it starts again after a restart. |
| The daily update job does not exist | An administrator can put it back with Restore Schedule, or recreate it in SQL Server Management Studio. |
| The daily update job is disabled | An administrator can enable it with Restore Schedule, or in SQL Server Management Studio: SQL Server Agent → Jobs, right-click the job, Enable. |
| The daily update job does not include this database | The job has one step per database, named after the database. An administrator can add this database's step with Restore Schedule. |
| The job's step for this database runs somewhere else | Change the step's database in SQL Server Management Studio. |
| The daily update job has no active schedule | An administrator can put back the Daily at 4:00 AM schedule with Restore Schedule, or attach or enable a daily schedule in SQL Server Management Studio. |
| The last refresh of this database failed | The screen shows SQL Server Agent's message for the failed run. |
| The last run stopped before it reached this database | A step for another database failed first, and SQL Server Agent does not run the steps after a failed one. Fix the database behind the failing step, or move this database's step ahead of it. |
| Building the inventory history failed | The procedures record a failure for a fiscal year while the job itself reports success. The daily update retries the year on every run. To see the error, run the daily update against the database in SQL Server Management Studio. |
| A refresh started and never finished | The job was stopped, SQL Server restarted, or the session ended part-way through. The next run repeats the work. |
Switching the warning off¶
The screen carries the checkbox Warn me when this database's inventory data is out of date. Clearing it stops the screen opening by itself, for you and for this database only, which suits a test database nobody refreshes. The status bar goes on showing the state of the data either way.
To switch the warning back on, open the screen from the Administration menu or the status bar and tick the checkbox again.
Permissions¶
The screen is available to every user. Out of administration mode, the only thing it changes is the user's own warning setting.
Refresh Now and Restore Schedule need administration mode. Out of administration mode they are shown unavailable, and holding the pointer over either one says why and how to turn administration mode on (Settings → Administration → Enable Administration Mode). Restore Schedule changes the job in SQL Server's msdb database, so the login PULSE Dashboard connects with needs permission to change SQL Server Agent jobs.
The check reads the inventory history status in the company database, and the job, its steps, schedules and history in msdb. When the login PULSE Dashboard connects with cannot read msdb, the screen says so. The age of the data is still accurate, because it comes from the company database, but whether the job is missing, disabled or failing cannot be seen, and a SQL Server administrator can check the job in SQL Server Management Studio. Reading whether SQL Server Agent is running needs the VIEW SERVER STATE permission; without it the Agent's state shows as Unknown on the Diagnostics tab.
Getting started
Inventory SP Data Status runs after the upgrade with nothing to configure. The warning is on for every user until they switch it off.