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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Convert text to integer with no commas (Not through personal options)

(0) ShareShare
ReportReport
Posted on by 90

I have a field (OrgId) which is currently a string, 10 char long under Accounts entity. The data is going to be an integer always. I did't have this as a number because it adds comma. I have other fields which are integer and needs comma. So in order to eliminate having commas, I made the OrgID field as string. Now when I am in the Accounts view and I am sorting by OrgID, it is not being sorted as integer and it is sorting as a string. Example. 102, 10001, 10057, 10069, 201, 2067, 21357, ...etc. I want the OrgID to be sorted like an integer, 102, 201, 10001, 10057, 10069, 21357....etc.

My issue is how can I convert this string field (OrgId) to act like an integer without having comma and also without affecting other integers formatting which needs comma. In the Accounts View, I should be able to sort the OrgID in ascending/descending order as integer type and not show any commas.

I know that I can do formatting (Set Personal Options/ Format) to not have commas but it affects all integer types. So that is not an option for me. Any help to show and describe in steps would be very helpful. If it needs some javascripting, please let help me with the steps which would be greatly appreciated. Or any other workarounds.

Thanks,
Vinay  

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Vinay,

    The easiest workardound for me - you can add srtarting zeros to your string so your sorting should work fine.

    So your example will be sorted like this:

    00102

    00201

    02067

    10001

    10057

    10069

    21357

    Good luck.

  • Vinay Hosamane Profile Picture
    90 on at

    Thank you Andrew. I like your solution, but have some constraints.

    My OrgId field is 10 characters long. Also I am using this in other calculated field which needs to use only the data in the OrgId field. It would work for sorting but would fail in my calculated field. Also I do not want to show leading zero for OrgID in Accounts view.

    Do you have other alternatives?  Really I appreciate your help. Thanks.

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Alternatively what you can do is plugins way:

    1. You can use "Whole Number" field and your plugin will have to handle Retrieve Multiple and change formatted value of the field to format without commas.

    2. You can have 2 fields - one string and one whole number, develop the plugin that will handle retrieve multiple message, check query and if "string" field is used for sorting - replace it with "whole number".

    Good luck!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 193 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 128

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans