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 Business Central later for processing.

Creating the Offline Application Header

Open the Offline Applications page in Business Central (search for Warehouse Insight Offline Applications).

  1. Create a new Offline Application called “COUNT”
  2. Give the application a suitable description
  3. Specify an “Event ID” of: “2000000
    1. This is the event ID called when the data is sent to Business Central.
  4. Set the “Auto Close” property to “After Send”
    1. This will close the application and bring the user back to the main screen after they hit Send
  5. Set the “Entry Mode” to “Combined”
    1. The questions will be asked in a single combined dialog rather than individual prompts.
  6. Set the “Auto Send” property to “No”
    1. 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.
  1. 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
  2. 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
  3. 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
  4. 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
  5. 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

  1. Open the Device Menus page in Business Central (search for Warehouse Insight Device Menus).
  2. Choose the “Main” form.
  3. Create a new menu option and set the following properties:
    1. Caption: Offline Count
    2. Icon Code: COUNT
    3. Standard Action: Offline Application
    4. Offline Application: COUNT
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

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 Business Central.

Offline Count

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

Count

The created entries will be saved until they are sent to Business Central for processing. You may close/re-open the application as needed and the entries will remain.

Offline Count

Press Send when you are ready to update Business Central.

View the Results in Business Central

Shown below is an example of the entries made after having sent to Business Central.

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?
Please submit the reason for your vote so that we can improve the article.
Need help?

Leave A Comment

Go to Top