web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :

Dynamic Business Central 365: Understanding AssistEdit Property with Example

Khushbu Rajvi. Profile Picture Khushbu Rajvi. 21,048 Super User 2025 Season 2

The AssistEdit property enhances user experience by adding a contextual Assist Edit (⋯) button to page fields. This allows developers to provide guided input, lookups, validations, or automated logic directly from the field—without forcing users to leave the page or remember complex values.

What Is the AssistEdit Property?

The AssistEdit property enables assist-edit functionality on a Page Field. When set to true, Business Central displays an AssistEdit button next to the field.

Key Details

  • Runtime Version: Available from runtime 1.0

  • Applies To: Page Field

  • Default Value: false

  • Purpose: Provide contextual assistance or custom logic via user interaction

Why Use AssistEdit?

AssistEdit is commonly used when:

  • Users need help selecting or generating values

  • Additional validation or preprocessing is required

  • A field requires context-aware logic

  • You want to improve usability without cluttering the UI

Simple Example: Generating a Reference Number

You want to generate a Document Reference No. automatically when the user clicks the AssistEdit button.

Table Extension: add a new field on Customer

tableextension 50110 "KR Customer AssistEdit Ext" extends Customer
{
    fields
    {
        field(50110; "KR Reference No."; Code[20])
        {
            Caption = 'KR Reference No.';
            DataClassification = CustomerContent;
        }
    }
}

Page Extension (extends default Customer Card)

pageextension 50121 "KR Customer Card AssistEdit" extends "Customer Card"
{
    layout
    {
        addlast(General)
        {
            field("KR Reference No."; Rec."KR Reference No.")
            {
                ApplicationArea = All;
                ToolTip = 'Click AssistEdit (⋯) to generate a reference number.';
                AssistEdit = true;

                trigger OnAssistEdit()
                var
                    NewRef: Code[20];
                begin
                    NewRef := GenerateReferenceNo();

                    // Optional overwrite confirmation
                    if Rec."KR Reference No." <> '' then
                        if not Confirm('Reference No. already exists (%1). Overwrite?', false, Rec."KR Reference No.") then
                            exit;

                    Rec.Validate("KR Reference No.", NewRef);
                    Rec.Modify(true);
                end;
            }
        }
    }

    local procedure GenerateReferenceNo(): Code[20]
    var
        DtTxt: Text;
        RefTxt: Text;
    begin
        // Example: CUST-YYYYMMDD-HHMM  (fits Code[20])
        DtTxt := Format(CurrentDateTime(), 0, '<Year4><Month,2><Day,2>-<Hours24,2><Minutes,2>');
        RefTxt := 'CUST-' + DtTxt;
        exit(CopyStr(RefTxt, 1, 20));
    end;
}

We extended the Customer Card by adding a custom field and enabled the AssistEdit property on that field. Using the OnAssistEdit trigger, we implemented logic to automatically generate and populate a reference number when the user clicks the AssistEdit (⋯) button. The value is validated and saved directly on the customer record.

Result: 
On click: generates a value like CUST-20260108-2230, validates, and saves





Thanks For Reading...!!😊
Regards,
Khushbu Rajvi




This was originally posted here.

Comments

*This post is locked for comments