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: FileUploadAction Property

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

Uploading files is a common requirement in Business Central, whether it is for importing documents, attaching images, or processing external data. Traditionally, developers had to rely on actions or complex logic to handle uploads. With newer runtime versions, Microsoft introduced a cleaner and more structured way to handle file uploads using the FileUploadAction property.

In this blog, we will understand what the FileUploadAction property is, why it is useful, and how to implement it with a practical example.

What is the FileUploadAction Property?

The FileUploadAction property specifies which page action should be executed automatically when a file is uploaded.

Instead of writing upload logic inside a field trigger, this property allows you to link a fileUploadAction directly to a page field. When the user uploads a file, Business Central automatically invokes the specified action.

Practical Example

Scenario

You want users to upload a file from a page field, and as soon as the upload is completed, a specific action should process that file, for example, storing it or reading its content.

page 50101 "Customer Order Tracker Enabled"
{
    PageType = List;
    SourceTable = "Sales Header";
    ApplicationArea = All;
    UsageCategory = Lists;

    AnalysisModeEnabled = True;

    layout
    {
        area(Content)
        {
            repeater(Group)
            {
            }
        }
    }
    actions
    {
        area(Processing)
        {
            fileUploadAction(UploadDocument)
            {
                Caption = 'Upload Document';

                trigger OnAction(Files: List of [FileUpload])
                var
                    File: FileUpload;
                    InS: InStream;
                begin
                    foreach File in Files do begin
                        File.CreateInStream(InS);
                        Message('Uploaded file: %1', File.FileName);
                        // Process file stream here
                    end;
                end;
            }
        }
    }
    var
        UploadFile: File;
}

Result




When the user uploads a file using the Upload File field:

  • Business Central automatically calls the UploadDocument action
  • The uploaded file is available as a stream
  • No additional button click is required
  • File handling logic runs immediately after upload

This creates a smooth, intuitive upload experience for the user.


Thanks For Reading...!!😊


Regards,

Khushbu Rajvi



This was originally posted here.

Comments

*This post is locked for comments