Skip to content
Development

How to Create a Calculator in D365 F&O: UI Design

Caf2Code July 15, 2021 4 min read

Now that we’ve set up our D365 F&O VS environment, we can create a model and project in visual studio for our simple calculator project.

Editor's update — June 2026: The form designer, control, group, and form-pattern workflow shown here (Apply pattern, Dialog - Basic, Fields and Field Groups, Auto Declaration) is still accurate in current Dynamics 365 Finance & Operations development. What has changed since 2021 is the development environment itself: Microsoft now provisions a cloud-based Unified Developer Environment (UDE) through the Power Platform admin center, which replaces the Lifecycle Services–deployed developer VMs referenced in our setup intro, and development is done in Visual Studio 2022. The in-Visual Studio steps below are otherwise unchanged. See Unified environment types and templates and the Form styles and patterns guidance.

Let's now build the user interface (UI) for our calculator.

UI Creation

1. Right click on the project name in the Solution Explorer, scroll to Add, and select New Item.

Original screenshot not recoverable from the web archive
NewItemExample.png

2. In the Dynamics 365 Items menu to the left, select User Interface and then select Form. Rename the form and click Add.

Original screenshot not recoverable from the web archive
NewFormExample-1.png

3. Right click on the Design | Pattern field, select Apply pattern, and click on Dialog - Basic.

Original screenshot not recoverable from the web archive
ApplyPatternExample.png

4. Right click on Design | Pattern, select New and click on Group.

    Original screenshot not recoverable from the web archive
    NewGroupExample.png

    5. Right click on the new group, select Apply pattern and click Fields and Field Groups.

    Original screenshot not recoverable from the web archive
    ApplyPatternGroupExample.png

    6. Right click on the group and select Duplicate. Repeat this action until you have four groups.

    Original screenshot not recoverable from the web archive
    DuplicateGroup.png

    6A. You should have four groups in your window pane.

    Original screenshot not recoverable from the web archive
    DuplicateExample.png

    7. Right click on the first group, select New and click on Integer. Repeat this action one more time for a total of two integers in group one.

    Original screenshot not recoverable from the web archive
    NewIntExample.png

    8. Right click on the second group, select New and click on Integer for a total of one integer in group two.

    Original screenshot not recoverable from the web archive
    TotalInts.png

    9. Right click on the first integer and click on Properties.
    Original screenshot not recoverable from the web archive
    IntProperties.png

    10. Change the value of Auto Declaration from "No" to "Yes" in the dropdown. You can also change the name of the integer to a more descriptive one (examples: Number1, Value2, Int1, Total etc.). Repeat these actions on the remaining integers (consider renaming the third integer "Total").

    Original screenshot not recoverable from the web archive
    AutoDeclaration.png

    11. Right click on Group3, select New and click on Button. Repeat this action once more in Group 3 for a total of two buttons.

    Original screenshot not recoverable from the web archive
    ButtonExample.png

    12. Right click on Group4, select New and click on Button. Repeat this action once more in Group 4. You should end up with two buttons in Group 3 and two buttons in Group 4.

    Original screenshot not recoverable from the web archive
    AllButtons.png

    12A. Right click on the first button in Group 3 and select properties. In the Text field under Appearance, type in an asterisk (*). In the Name field under Data, type in "Multiply".

    Original screenshot not recoverable from the web archive
    Multiply.png

    12B. Right click on the first button in Group 3 and select properties. In the Text field under Appearance, type in a forward slash (/). In the Name field under Data, type in "Divide".

    Original screenshot not recoverable from the web archive
    Divide.png

    12C. Right click on the first button in Group 3 and select properties. In the Text field under Appearance, type in a plus sign (+). In the Name field under Data, type in "Add".

    Original screenshot not recoverable from the web archive
    Add.png

    12D. Right click on the first button in Group 3 and select properties. In the Text field under Appearance, type in a dash (-). In the Name field under Data, type in "Subtract".

    Original screenshot not recoverable from the web archive
    Subtract.png

    13. Right click on Design | Pattern, select New and click on Button Group.

    Original screenshot not recoverable from the web archive
    AddButtonGroup.png

    14. Right click on button group, select New and click on Button. Repeat for a total of two buttons.

    Original screenshot not recoverable from the web archive
    ButtonExample-1.png

    15. Right click on the first button, and click on properties. Change Name value found under Data to "OK" and Text value found under Appearance to "OK".

    Original screenshot not recoverable from the web archive
    RenameButton.png

    16. Right click on the second button, and click on properties. Change Name value found under Data to "Cancel" and Text value found under Appearance to "Cancel".

    Original screenshot not recoverable from the web archive
    ButtonsDone.png

    17. The Calculator UI is now complete. Your form should look similar to this (it's ok if the fields are a bit off as long as they are on screen).

    Original screenshot not recoverable from the web archive
    FinalForm.png

    Stay tuned for part 4 where we will complete the code to add functionality to our calculator.

    (Special thanks to the Ali Mahar YouTube page for the inspiration for this series.)

    Caf2Code is a Microsoft Solutions Partner specializing in Dynamics 365 Finance & Operations, Power Platform, and Power BI. Originally published July 15, 2021; restored to caf2code.com in 2026.

    Working on Dynamics 365 or Power Platform?

    Caf2Code is a Microsoft Solutions Partner. Whether it is F&O development, security, reporting, or an end-to-end implementation, our team can help.