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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Getting the Maximum Length of a field

(0) ShareShare
ReportReport
Posted on by 47

I have a field of type Single Line of Text. I need to retrieve the Maximum Length of that field and use it in my TypeScript File. How do I do it?

I have the same question (0)
  • Suggested answer
    ajyendra Profile Picture
    1,738 on at

    Hi,

    In JavaScript you can get this by using getMaxLength() function

    Xrm.Page.getAttribute("name").getMaxLength();

    OR

    formContext.getAttribute("name").getMaxLength();

  • Sunayana Profile Picture
    47 on at

    How can I do this in TypeScript?

  • Suggested answer
    ajyendra Profile Picture
    1,738 on at

    Same as in Javascript using getMaxLength() function

    Check this Link:

    mktange.com/.../

    medium.com/.../transpile-typescript-modules-for-dynamics-365-simply-using-rollup-js-9fb0f4f3eebd

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 98

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 60 Super User 2025 Season 2

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans