> For the complete documentation index, see [llms.txt](https://www.neptune.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.neptune.tech/development-tools/scanning/tutorial.md).

# Tutorial: count fixed assets

Tutorial - build a scanning scenario of your own step by step, the stocktake of fixed assets - the action, the context of the form, the phone and a scanning operation.

This tutorial builds a complete scanning scenario step by step in a model of your own: the stocktake of fixed assets, the action **Count fixed asset**. Advanced Suite has no such action: everything here is your code — an enum extension, your classes and Chain of Command on the extension points of the framework. Build a scenario of your own the same way.

**The scenario.** Someone walks from room to room and scans the asset tags. On **Fixed assets locations** they select the room, for example **HQ\_2ND\_FL**, and scan:

* the asset gets today as its **Physical inventory** date;
* an asset registered at another location moves to this one, and the log says where it came from;
* a tag of no asset, or of an asset counted today already, is an error — red in the log and on the phone.

The same code then works with every input of the **Scanning** pane — manual entry, a list pasted from Excel, a file, a scanner on the serial port, the phone in real time — and, as a **scanning operation**, on a phone that scans the location offline and submits it.

## See it in action

A 7-minute video for developers: steps 1 to 4 written in Visual Studio and tried in Dynamics 365 — tags typed and a list pasted in the **Scanning** pane, the phone in real time, then the location sent to the phone, scanned and added by the batch. Step 5 is on this site only.

{% embed url="<https://980223628-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBT7AhPDmzqW9GObzesdP%2Fuploads%2Fgit-blob-3eeb87fde23ce8071a1e3e84ddd6c8c94c30fa0a%2Fscanning-framework-tutorial.mp4?alt=media>" %}
Your own scanning action in X++: the tutorial video (7 min, Full HD)
{% endembed %}

{% file src="/files/wNfpuvcqPyTbSAUPJdRC" %}
Download the video (MP4, 25 MB)
{% endfile %}

## The steps

| Step                                                                                                                      | What you build                                                                      | Framework                                                                 |
| ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| [1. The action](https://www.neptune.tech/development-tools/scanning/tutorial/1-the-action.md)                             | The action type **Count fixed asset** and its handler                               | `ScanningActionType_AdvancedSuite`, `ScanningAction_AdvancedSuite`        |
| [2. The context of the form](https://www.neptune.tech/development-tools/scanning/tutorial/2-the-context.md)               | **Fixed assets locations** in the pane: the current location, the action by default | `ScanningContext_AdvancedSuite`                                           |
| [3. Try it](https://www.neptune.tech/development-tools/scanning/tutorial/3-try-it.md)                                     | Build, scan in the pane, paste a list, check the rights, scan with the phone        | —                                                                         |
| [4. A scanning operation](https://www.neptune.tech/development-tools/scanning/tutorial/4-a-scanning-operation.md)         | The location sent to a phone, scanned offline, added in batch                       | `ScanningOperationSend_AdvancedSuite`, `ScanningOperations_AdvancedSuite` |
| [5. Extend a standard action](https://www.neptune.tech/development-tools/scanning/tutorial/5-extend-a-standard-action.md) | A rule of your own in receiving: no more than ordered                               | Chain of Command on the line actions                                      |

## Before you start

* **Advanced Suite on your development environment.** Install the package ([Install ISV package](https://www.neptune.tech/advanced-suite/getting-started/install-the-isv-package.md), [Releases](https://www.neptune.tech/advanced-suite/releases.md)) and add **AdvancedSuite** to the referenced packages of your model ([Before you start](https://www.neptune.tech/development-tools/development-tools.md#before-you-start)).
* **No license for your own code.** Actions and contexts of your own run without a license, in every environment ([Developer edition](https://www.neptune.tech/resources/pricing.md#advanced-suite-developer-edition)).
* **Data.** The tutorial uses the demo company USMF: its fixed assets have bar codes (**COMP-000001** …) and locations (**HQ**, **HQ\_1ST\_FL**, **HQ\_2ND\_FL** …).
* **Names and labels.** The elements here have the prefix `My` — `MyScanningAction_CountFixedAsset`, the enum value `MyCountFixedAsset`; give yours your own prefix or suffix. The messages are labels of the model's label file `MyLabels`. For a scenario of your own, take your form and your table where the steps have the fixed asset location.

{% hint style="info" %}
The building blocks used here are described in [Scanning framework](https://www.neptune.tech/development-tools/scanning.md): [Actions](https://www.neptune.tech/development-tools/scanning/actions.md), [Contexts](https://www.neptune.tech/development-tools/scanning/contexts.md), [Scanning operations for your documents](https://www.neptune.tech/development-tools/scanning/scanning-operations-for-your-documents.md) and [Order and journal line actions](https://www.neptune.tech/development-tools/scanning/order-and-journal-line-actions.md).
{% endhint %}
