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 :
Microsoft Dynamics CRM (Archived)

Remove comma from a custom field created as an auto counter

(0) ShareShare
ReportReport
Posted on by

Greetings, I created a field (AutoNum) in the Leads entity and Workflows to increment by 1 when creating a new record.  Works well - EXCEPT, the number carries comma (thousand separator).  How do I remove that comma for this field only.  Don't want to mess with other whole number fields in CRM.  Thanks!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Mithilesh Kumar Profile Picture
    10,047 on at

    Hi Victor,

    If you use Number field you will get that comma.

    You can create a Text Field to store the value of number using Business Rule of JScript. Use this Text Field to show in Views.

    This will also solve your problem of Searching using Quick Find as wild search for Number field does not work.

    You can see this as well for Auto Number generation

    https://arunpotti.wordpress.com/2014/03/21/auto-number-generation-using-real-time-workflow-in-ms-crm-2013/

    Hope that helps

    Thanks

  • Community Member Profile Picture
    on at

    Thanks for the quick response!  Unfortunately, I'm not a JScript guy...  any examples you could provide would be immensely appreciated!

  • Community Member Profile Picture
    on at

    Forgot to mention- used the realtime workflow per your link as well.  Thanks again!

  • Verified answer
    Mithilesh Kumar Profile Picture
    10,047 on at

    Hi Victor,

    You can follow this for reference.

    community.dynamics.com/.../zero-code-development-quick-find-wild-card-search-on-whole-number-field-in-dynamics-crm-2015.aspx

    Thanks

  • Community Member Profile Picture
    on at

    OK - I can try this - however, how to I remove the comma when the number is displayed in a form?  Thanks again!

  • Verified answer
    Mithilesh Kumar Profile Picture
    10,047 on at

    Victor,

    You need to hide the Number Field and Show the Text Field.

    Thanks

  • Community Member Profile Picture
    on at

    Got it - Thanks!

  • Verified answer
    Mithilesh Kumar Profile Picture
    10,047 on at

    Welcome !!

  • Verified answer
    Mahadeo Matre Profile Picture
    17,021 on at

    Hi Victor,

    There is not supported option to remove comma unless you change format for whole organization..

    if you want With unsupported way.. then try this

    function FormatNumber()

    {

     var number=  Xrm.Page.getAttribute("new_recordid").getValue();

     document.getElementById("new_recordid").childNodes[1].childNodes[1].childNodes[0].nodeValue= number;

    }

    Call This function on your form load and change "new_recordid" with your attribute, and also make this attribute read-only..

    because when focus is changed from this field CRM is formatting this attribute again with comma..

    Hope This will help..

  • Suggested answer
    triangular Profile Picture
    162 on at

    Hi,

    I tried the above solution and it works great. 

    Fyi I don't have to make the field read-only if users modifies it then it would not change back with the commas - I just have to enable the script on the OnChange event for that field.

    Thanks.

    -tri

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans