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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Word count

(1) ShareShare
ReportReport
Posted on by 5
Hi guys,
 
Is possible to show a word count field in business central ? 
Let says there is a field to show 0/100 in the field. When I have inputted 10 words, it will updated as 10/100. 
Is it possible for any coding solution >_< ?
 
Many thanks !!
I have the same question (0)
  • Suggested answer
    Shrey Chauhan Profile Picture
    286 on at
    Hello,

    Here's the reference and code for the word count field in business central : 
     
     
    field(2; Name; Text[100])
            {
                Caption = 'Name';
                trigger OnValidate()
                var
                    Length: Integer;
                    MaxLength: Integer;
                begin
                    Length := StrLen(Rec.Name);
                    MaxLength := MaxStrLen(Rec.Name);
                    "Word Count" := Format(Length) + '/' + Format(MaxLength);
                end;
            }
    field(15; "Word Count"; Text[250])
            {
                DataClassification = ToBeClassified;
            }
     
    Hope this solution's help's.

    Thank you,
    Shrey Chauhan.
  • Suggested answer
    Judy Profile Picture
    Microsoft Employee on at
    Hi, you can use the Text.StrLen(Text) Method to get the length of a string you define.
     
    Best Regards,
    Judy

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,386 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,774 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,515

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans