Sample Offline Application

Home/Sample Offline Application

Sample Offline Application

You are here:

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

Open the Offline Applications page in NAV (Departments -> Warehouse Insight -> Setup -> Offline Applications).
  • 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 
Offline Application

Creating the Offline Application Fields

Create fields/questions for each of the data pieces that we will be collecting.
  • 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
Fields

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
Main Menu

Creating a Codeunit to Process the Entries

At it’s core the processing function must loop through the records based on event parameters matching this format: entry_%1_%2
Where “%1” is the entry line number and “%2” is the field name.  The number of lines/entries is stored in the event parameter value ‘count’.
 
An example of the processing function might look like this:
Entries

The extension codeunit used has also been attached to this article for reference.

Download the Codeunit

Using the Application

The Offline Application will appear on the handheld main screen listing, similar to this:
Warehouse Insight Application
Note: You must have established a connection to NAV prior to going offline to download the offline application structure.  Once downloaded a connection will only be required when ready to send the entries.

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.

Offline Count

Entering data (in a combined entry screen) will look like this:

Count
Note: Subsequent entries will not prompt for the “Sheet Name” again as it was set to repeat mode.  The Bin Code will be shown but filled in with the last entered bin.

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.

Offline Count

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.

Count Sheet
Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Need help?

Leave A Comment

Go to Top