Skip to content

Warehouse Insight · Set up

Updating Configuration via Intents

Applies to Warehouse Insight 3.0 Last verified November 23, 2026

Warehouse Insight allows intents and URIs to be used to change device-specific configuration values. The sample PowerShell script in this article can be used on either Android or Windows.

The sample script works for any docked device, emulator or active Windows instance.

Before you start

  • The device must already have a Warehouse Insight software configuration. For details on each setting, see Configuration.
  • You need the configuration password currently set on the device. If the password in the script does not match, the configuration is not changed.
  • For Android devices, the Android Debug Bridge (adb) must be available on the computer that runs the script, and the device or emulator must be connected to it.
  • For Windows, run the script on the computer where Warehouse Insight is installed.

Update the script

The script contains several sections that must be updated as needed. Each of those sections is prefixed with a “Required:” comment.

  1. Set the target environment. Uncomment the $Target line for Android or Desktop, and comment out the other one.
  2. Set $configPassword to the configuration password currently set on the device.
  3. Set $reloadConfig to “1” if the device should reload the configuration after the changes are applied, or “0” if a reload is not wanted.
  4. In the $config section, uncomment each setting you want to change and enter its new value. The comment after each setting gives its name in Warehouse Insight and, where needed, the allowed values.
  5. Save the script and run it in PowerShell.

How the script applies the changes

  • Android: The script sends the settings to the device as a broadcast intent through adb. If the adb command is not found, update the script with the path to adb.
  • Desktop: The script launches a whi-device-management://set-config URI on the Windows computer.

In both cases, the script displays the configuration JSON and the command or URI it runs.

Sample script

#
# Required: Comment/Uncomment the target environment you are looking to update
#
param(
    [ValidateSet("Android", "Desktop")]
    #[string]$Target = "Desktop"
    [string]$Target = "Android"
)

#
# Required: The configuration password must match the one currently set on the device.
#           If it does not, the configuration will not be changed.
#
$configPassword = "1234"

#
# Required: If you wish the device to reload the configuration after applying the changes set this variable
#           to "1". If a reload is not desired set it to "0"
#
$reloadConfig = "1"


#
# Required: All parameters have been included here that can be changed.  Uncomment and set as desired.
#
$config = @{

    #config_id                     = ""     # Configuration Code
    #odataservice                  = ""     # Web Service
    #company                       = ""     # Company Name
    #signon_mode                   = ""     # Login Method: 0 = Windows; 1 = OAuth; 2 = Oauth - On-Premise; 3 = OAuth - Service to Service; 4 = OAuth - User Impersonation; 5 = OAuth Modern (MSAL)
    #oauth_authorization_uri       = ""     # Authorization URI
    #oauth_token_uri               = ""     # Token URI
    #oauth_redirect_uri            = ""     # Redirect URI
    #oauth_scopes                  = ""     # Scopes
    #oauth_tenant_id               = ""     # tenant id
    #oauth_client_secret           = ""     # Client Secret
    #clear_cookies                 = ""     # Clear Cookies: 0 = No; 1 = Yes
    #use_iwxusers                  = ""     # Use Additional Insight Works User Login: 0 = No; 1= Yes
    #device_hostname               = ""     # Device Name
    #config_password               = ""     # Configuration Password
    #connection_timeout            = ""     # Connection Timeout
    #screen_orientation            = ""     # Screen Orientation: 0 = Auto; 1 = Portrait; 2 = Landscape
    #current_theme                 = ""     # Theme: 0 = "Default"; 1 = "Twilight"; 2 = "Spring"; 3 = "Earth"
    #barcode_wedge                 = ""     # Barcode Wedge: 0 = Android Intent; 1 = Keyboard Prefix/Suffix
    #android_intent_action         = ""     # Intent Action
    #android_intent_category       = ""     # Intent Category
    #android_intent_barcode_string = ""     # Intent Barcode String
    #barcode_prefix                = ""     # Barcode Prefix
    #barcode_suffix                = ""     # Barcode Suffix
    #use_camera_scanner            = ""     # Use Camera: 0 = No; 1 = Yes
    #loglevel                      = ""     # Log Level: 0 = Off; 1 = Trace; 2 = Debug; 3 = Info; 4 = Warn; 5 = Error; 6 = Fatal
    #log_max_size                  = ""     # Max Log Size (MB)
    #log_to_console                = ""     # Log to Console: 0 = No; 1 = Yes
    #log_to_network                = ""     # Log to Network: 0 = No; 1 = Yes
    #log_to_network_address        = ""     # Log to Network Address
    #enable_compression            = ""     # Enable Compression: 0 = No; 1 = Yes
    #use_store_and_forward         = ""     # Store & Forward: 0 = No; 1 = Yes
    #prompt_scratchpad_offline     = ""     # Prompt for Scratchpad When Offline: 0 = No; 1 = Yes
    #image_capture_width           = ""     # Image Capture Width (px)
    #image_capture_height          = ""     # Image Capture Height (px)
    #image_capture_rotation        = ""     # Image Capture Rotation (degrees)
    #show_cache_details_menu       = ""     # Show Cache Details Menu: 0 = No; 1 = Yes
    #show_update_apps_menu         = ""     # Show Update Applications Menu: 0 = No; 1 = Yes
}

$json = $config | ConvertTo-Json -Compress

Write-Host "Config JSON:"
Write-Host $json

switch ($Target) {
    "Android" {
        $base64Json = [Convert]::ToBase64String(
            [System.Text.Encoding]::UTF8.GetBytes($json)
        )

        $configPasswordBase64 = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($configPassword))
        $reloadConfigBase64 = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($reloadConfig))

        $arguments = @(
            "shell", "am", "broadcast",
            "-a", "whi-device-management",
            "--es", "command", "set-config",
            "--es", "json", $base64Json,
            "--es", "config_password", $configPasswordBase64,
            "--es", "reload", $reloadConfigBase64
        )

        # Note: If the "adb" command is not found, update the path to the file as needed

        Write-Host ""
        Write-Host "ADB command:"
        Write-Host ($arguments -join " ")

        & adb @arguments
    }

    "Desktop" {
        $escapedJson = [Uri]::EscapeDataString($json)
        $uri = "whi-device-management://set-config?config_password=$configPassword&reload=$reloadConfig&json=$escapedJson"

        Write-Host ""
        Write-Host "Launching URI:"
        Write-Host $uri

        Start-Process $uri
    }
}

View this article as Markdown

Still need help?

Ask other Business Central users in the Insight Works community, or send the details to the support team. Include the steps you took and any error message you saw.