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 :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Display issues with rounded decimal value in a form field

(0) ShareShare
ReportReport
Posted on by 99

Hello everyone,

I have a real field that when user input in should only display the rounded value without any decimals even if zeroes, a simple decRound in the modified method of the field acheived that with the help of changing the NoOfDecimals to 0 and MinNoOfDecimals to 0 but the problem is that when the value is displayed; it isn't aligned properly to the right side even if alignment is set to right, when the form opens it display them as they should be but when hovering over them or selecting them; a wierd space is created which leaves the values not in the right nor centered (I only need right alignement, centered and left work fine though)
This is a screenshot of the form when opened:
field-issue-1.jpg

and this when I move the cursor over the other values and they change their location too:
field-issue-2.jpg

the code in modified of the field is (I tried here to convert value to int in an attempt to solve the issue):

public boolean modified()
{
    boolean ret;
    
    ret = super();

    ProdBOM.BOMQtySerie = real2int(decRound(ProdBOM.BOMQtySerie, 0));
    
    return ret;
}

my guess of the issue is that that space is for decimal values which are some zeroes that aren't shown since when I get NoOfDecimals to Auto and MinNoOfDecimals to Auto then I get the value followed by a comma and 3 zeroes

The field is BOMQtySerie from ProdBOM table and uses BOMQtySerie for EDT (all of these are in standard value and this is AX R2)

My next guess is trying to force these formControl value with the aid of X instead of properties but sadly I can't seem to find any documentation or help to do so
(my attempt is: 

public boolean modified()
{
    boolean ret;
    
    ret = super();

    ProdBOM.BOMQtySerie = real2int(decRound(ProdBOM.BOMQtySerie, 0));
    //ProdBOM_BOMQtySerie.alignment(0);
    //ProdBOM_BOMQtySerie.noOfDecimals(0);
    //ProdBOM_BOMQtySerie.minNoOfDecimals(0);
    
    return ret;
}

My attempt is commented since I don't know the int values correspondance of these methods and it didn't seem to change anything when I type 0 and 1 there)

Thanks in advance and hopefully I explained the issues as better as I could ^_^.

I have the same question (0)
  • Suggested answer
    Deepak Agarwal Profile Picture
    8,602 on at

    Hi Ben,

    Thanks for the detailed explanation about the issue. Here is my thought.

    If you anyways need to round this field, use integer instead of real, also write your business logic in the inert method, if you are expecting the user can update this value from the front end you may consider table modified field method.

    Let me know if this helps.

  • Fares Ben Miled Profile Picture
    99 on at

    Hi Deepak and thank you for your suggestion,

    user can update the value in the form so I tried using the modified field of the table like you mentioned but I still got the same result.

    The form, the table, the field and the EDT are all standard that are used in various places so I can't change its type.

    I forgot to mentio this if it could help but the form that I am working on is ProdBOM.

    Thanks again for your thoughts and I am open to others ^_^.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 467 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 420 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 241 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans