Sample Offline Application
This article will describe the process of building and consuming a simple offline application to capture inventory count information.
First, it is important to note that “Offline” applications are essentially a series of user prompts designed to gather information.
This information is stored/persisted on the device and sent to NAV at a later date for processing.
Creating the Offline Application Header
- Create a new Offline Application called “COUNT”
- Give the application a suitable description
- Specify an “Event ID” of: “2000000
- This is the event id that will be called when the data is sent to NAV
- Set the “Auto Close” property to “After Send”
- This will close the application and bring the user back to the main screen after they hit Send
- Set the “Entry Mode” to “Combined”
- The questions will be asked in a single combined dialog rather than individual prompts.
- Set the “Auto Send” property to “No”
- Users must explicitly choose to send the entries when a viable connection has been established
Creating the Offline Application Fields
- Create a field to prompt the user for the count sheet name
- Name: SheetName
- Caption: Sheet Name
- Prompt: Enter the Sheet Name
- Data Type: String
- Required: Yes
- Repeat Mode: Repeat and Skip
- Once the user enters a sheet name it will not be prompted for again
- Create a field to prompt the user for the Bin code
- Name: BinCode
- Caption: Bin
- Prompt: Enter the Bin
- Data Type: String
- Required: Yes
- Repeat Mode: Repeat and Show
- This will persist the Bin between entries but allow the user to change
- Create a field to prompt the user for the Item number
- Name: ItemNumber
- Caption: Item
- Prompt: Enter the Item
- Data Type: String
- Required: Yes
- Repeat Mode: No Repeat
- Create a field to prompt the user for the Quantity
- Name: Quantity
- Caption: Quantity
- Prompt: Enter the Quantity
- Data Type: Decimal
- Required: Yes
- Repeat Mode: No Repeat
- Create a field to prompt the user for the Unit of Measure
- Name: UOM
- Caption: Unit of Measure
- Prompt: Choose the Unit of Measure
- Data Type: Option
- Required: Yes
- Option Values: PCS,BOX
- Default Value: PCS
- Repeat Mode: No Repeat
Creating the Main Menu Option
- Open the Device Menus page in NAV (Departments -> Warehouse Insight -> Setup -> Device Menus)
- Choose the “Main” form
- Create a new menu option:
- Caption: Offline Count
- Icon Code: COUNT
- Standard Action: Offline Application
- Custom 1: COUNT
- The name of the Offline Application header previously created
Creating a Codeunit to Process the Entries
The extension codeunit used has also been attached to this article for reference.
Using the Application
Clicking on the module will lead to the entry screen where you will be able to add/delete/update entries and finally send them to NAV.
Entering data (in a combined entry screen) will look like this:
The created entries will be saved until they are sent to NAV for processing. You may close/re-open the application as needed and the entries will remain.
Press the “Send” menu option when ready to update NAV.
View the Results in NAV
Shown below is an example of the entries made after having sent to NAV.