I need to apply Character Count on one of field in my Entity in MS Dynamic CRM 2016.
Thanks in Advance
*This post is locked for comments
I need to apply Character Count on one of field in my Entity in MS Dynamic CRM 2016.
Thanks in Advance
*This post is locked for comments
Mark the answer as verified.
Thank you so much.
It is realy helpful :)
Thank once again
https://community.dynamics.com/crm/f/117/t/200221
Use addOnKeyPress method for Text or numeric field. Multiple lines of Text field doesn't support this method.
// Call this function on load of form. // fieldname: Field whose character are to be counted. // fieldCountName: Field where character count is displayed. Single Line of Text function setCharacterLength(fieldname, fieldCountName) { var nameKeyPressFunction = function (ext) { //Get the value from the name field on the form var fieldVal = Xrm.Page.getControl(fieldname).getValue(); if (fieldVal != null) { var Length = fieldVal.length; Xrm.Page.getAttribute(fieldCountName).setValue(Length.toString()); } else{ Xrm.Page.getAttribute(fieldCountName).setValue("0"); } } Xrm.Page.getControl(fieldname).addOnKeyPress(nameKeyPressFunction); }
Refer this for Multiple lines of text field :
www.magnetismsolutions.com/.../Dynamics_CRM_2011_Calling_OnKeyDown_With_Javascript.aspx
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,280 Super User 2024 Season 2
Martin Dráb 230,235 Most Valuable Professional
nmaenpaa 101,156