Skip to main content

Notifications

Announcements

No record found.

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 !!
  • Suggested answer
    Judy Profile Picture
    Judy Microsoft Employee on at
    Word count
    Hi, you can use the Text.StrLen(Text) Method to get the length of a string you define.
     
    Best Regards,
    Judy
  • Suggested answer
    Shrey Chauhan Profile Picture
    Shrey Chauhan 271 on at
    Word count
    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.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans