---
id: post/yzhums-com/74975
type: post
title: "Dynamics 365 Business Central: Add a calculator to the sales order page"
summary: This post explains how to add a calculator control to the sales order page in Business Central using control add-in objects built with AL and JavaScript. It covers built-in calculation features, control add-in architecture, dimension properties, scripting options, and integration into pages.
tier: community
language: en
tags:
  - control add-in
  - javascript
  - al code
  - user interface
  - custom controls
  - page development
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-26T06:39:39.111Z"
  flags: []
generated:
  at: "2026-10-26T05:51:10.938Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: 2349e4fa87daf4097d23c835eb950f3d7056602970db43cb59112b16e5dcb0c4
evidence:
  - kind: blog
    url: https://yzhums.com/74975/
    title: "Dynamics 365 Business Central: Add a calculator to the sales order page"
    date: "2026-07-28"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://yzhums.com/74975/
    title: "Dynamics 365 Business Central: Add a calculator to the sales order page"
    date: "2026-07-28"
    commit: null
    t: null
    quote: A control add-in object is created with the use of AL code and JavaScript.
  - kind: blog
    url: https://yzhums.com/74975/
    title: "Dynamics 365 Business Central: Add a calculator to the sales order page"
    date: "2026-07-28"
    commit: null
    t: null
    quote: Standard Business Central already includes calculation features, but it requires you to input formulas directly into the fields.
  - kind: blog
    url: https://yzhums.com/74975/
    title: "Dynamics 365 Business Central: Add a calculator to the sales order page"
    date: "2026-07-28"
    commit: null
    t: null
    quote: For each control add-in, Business Central will generate an Iframe element, where it will dynamically load the control.
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
post_id: "74975"
source_id: yzhums-com
source_name: Dynamics 365 Lab - Yun Zhu
url: https://yzhums.com/74975/
published_at: "2026-07-28T01:37:45.000Z"
author: Yun Zhu
full_text: false
words: 821
quotes:
  - text: A control add-in object is created with the use of AL code and JavaScript.
    why_it_matters: Explains the core technical approach to building custom UI components beyond native AL capabilities
  - text: Standard Business Central already includes calculation features, but it requires you to input formulas directly into the fields.
    why_it_matters: Establishes why a dedicated calculator add-in is needed despite existing calculation support
  - text: For each control add-in, Business Central will generate an Iframe element, where it will dynamically load the control.
    why_it_matters: Clarifies the technical implementation architecture of how custom controls are rendered in the client
code_objects_mentioned: []
systems:
  - development
  - sales
versions_mentioned: []
preview:
  embeddable: true
  frame_url: null
  image: https://yzhums.com/wp-content/uploads/2026/07/Snipaste_2026-07-27_15-38-54.png
  image_alt: null
  image_w: null
  image_h: null
  site_name: Dynamics 365 Lab
  favicon: https://yzhums.com/wp-content/uploads/2020/08/cropped-logo-3-32x32.png
  probed_at: "2026-10-26T06:02:16.641Z"
---

# Dynamics 365 Business Central: Add a calculator to the sales order page

[Read the post](https://yzhums.com/74975/) · Dynamics 365 Lab - Yun Zhu (Yun Zhu, MVP) · 2026-07-28 · 821 words · tier community · reviewed (checked by Opus)

> This post explains how to add a calculator control to the sales order page in Business Central using control add-in objects built with AL and JavaScript. It covers built-in calculation features, control add-in architecture, dimension properties, scripting options, and integration into pages.

## Key points

- Business Central natively supports inline calculations in fields using formulas like 19+19 or 12*4, but adding a dedicated calculator requires control add-in objects
- Control add-ins are custom visual elements created with AL code and JavaScript that can exchange data and respond to user interactions
- Control add-ins use Iframe elements and support dimension properties like RequestedHeight, MinimumWidth, MaximumHeight, and stretch/shrink behaviors
- Scripts can be loaded locally from the extension or externally via HTTP(S), with separate startup, recreation, and refresh scripts available
- Control add-ins are inserted into pages using the usercontrol keyword and can be embedded in factboxes or other page elements

## Quotes

- "A control add-in object is created with the use of AL code and JavaScript." (Explains the core technical approach to building custom UI components beyond native AL capabilities)
- "Standard Business Central already includes calculation features, but it requires you to input formulas directly into the fields." (Establishes why a dedicated calculator add-in is needed despite existing calculation support)
- "For each control add-in, Business Central will generate an Iframe element, where it will dynamically load the control." (Clarifies the technical implementation architecture of how custom controls are rendered in the client)

## Context

- Features: control add-in objects, JavaScript integration, inline field calculations, custom visual controls, Iframe rendering, dynamic styling with CSS, external script loading, usercontrol keyword

Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.
