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 AX (Archived)

Hide decimals for JPY (main currency) but display them for other currencies.

(0) ShareShare
ReportReport
Posted on by

Hello dear community,

I plan to do some adjustments in a environment that will be used in Japan. In this environment the JPY will be used as default currency, also we will use other currencies like USD, CAD ... The main question is: How I can customize my application in order to hide decimals for JPY (main currency) but display them for other currencies.

I analyzed some ways to do this:

  1. Modify the Amount EDT - Number of decimals property = 0 # But I'm not sure if it's a good idea.
  2. Modify the objects where the amount is displayed in order to hide / show decimals in dependency of the used currency. # But I need to modify too many objects.
  3. Use the Round off parameter = 1.00 for JPY currency. # The Value will be rounded always but .00 decimals will be displayed also ...

So, if somebody has a implementation experience for Japan, please share your suggestions.

Thanks in advance,

Victor Para.

*This post is locked for comments

I have the same question (0)
  • Sami CHNITER Profile Picture
    25 on at

    Hi,

    That is what i want to do. Any solution please?

    Cordially,

  • Alok Joshi Profile Picture
    540 on at

    Did you guys get any solution to solve this problem?

  • Alok Joshi Profile Picture
    540 on at

    Or rather what's the best way to approach it?

  • Marek Korejwo Profile Picture
    40 on at

    Hi,

    I had very similar demad and came that only solution #2 can solve the problem, but practically it  is not feasible (for the given reasons). Basically neither EDT of form control is currency sensitive and I can't find a way to make them as that.

    Mark

  • Alok Joshi Profile Picture
    540 on at

    Hi all,

    There is one more way we have tried (In AX 2012 VPC - Single tier solution) achieving it and it looks like its visually working. However for some of you this may not sound as a full-proof solution.

    1) Navigate to your OS -> Control panel -> Region and language -> Location tab -> Change this to "Japan".

    2) Navigate to your OS -> Control panel -> Region and language -> Format tab -> Change this to Japanese (Japan) -> Click Additional settings -> Numbers tab -> No. of digits after decimal column -> Change this to "0". -> click OK -> Click OK -> Click Close.

    3) Restart AX service.

    4) Open AX -> Accounts receivable -> Select any customer -> Click on balance -> Watch out the amounts.

    You will notice that there are no decimals shown now in any amounts. So at least we can visually see what we want to achieve.

    However we need to test this on a 3 tier architecture to make sure its fit for purpose. Thought to share this as others may also contribute if there is anything else that can be done.

    I am also interested to know how others approached and resolved it.

  • Maciej Obojski Profile Picture
    610 on at

    Hi,

    you might get away with option #2 without putting in too much development effort.

    What you could potentially do is stick some code in 'SysSetupFormRun' class  - you would execute it only when current company is Japan (or whatever you need). The code would iterate through all the controls on the form and would check if the field is presenting values from a table - if so, you would need to check whether the underlying datatype extends Amount, or AmountCur.

    I have developed quick & dirty Proof Of Concept:

    I added new method in the SysSetupFormRun class:

    private void checkControls(FormBuildControl _grp = null)
    {
        int                 i, ctrlCnt;    
        Object              ctrl;
        Object              contain;
        FormRealControl     realControl;
        DictField           dictField;
        DictType            dictType;
        
        
        if (_grp == null)
        {
            ctrlCnt = this.design().controlCount();
            contain = this.design();        
        }
        else
        {
            ctrlCnt = _grp.controlCount();      
            contain = _grp;        
        }
        for (i = 1 ; i <= ctrlCnt; i++)
        {       
            ctrl = contain.controlNum(i);
            if(ctrl.isContainer())
            {
                this.checkControls(ctrl);
            }
            else
            {
                if (ctrl is FormRealControl)
                {                
                    realControl = ctrl;
                    if (realControl.dataField())
                    {
                        dictField  = new DictField(realControl.dataSourceObject().table(), realControl.dataField());
                        dictType = new DictType(dictField.typeId());                                
                    }
                    
                    if (dictType && dictType.extend() == extendedTypeNum(AmountCur))                
                        realControl.noOfDecimalsValue(0);                
                }
            }
        }    
    }

    And I simply invoke it in the 'init' method:

    public void init()
    {
        boolean hideDecimalsIfCurCompanyIsJapan = true;
        super();
        

        if (this.isWorkflowEnabled())
        {
            workflowControls = SysWorkflowFormControls::construct(this);
            workflowControls.initControls();
        }
        
        if (hideDecimalsIfCurCompanyIsJapan)
            this.checkControls();
    }

    Please note that this code will execute for every form in the system - so heavy forms, containing lots of fields may take noticeable amount of time to open - for those ones it might be useful make the change manually in the form, and add a condition not to execute this recursive method.

    Also you might want to consider adding support for display methods, that would return the required extended dataType(s)

    After putting this code in application, this is the screen I received:

    As you can see - the fields in the grid, which show values from table do not have decimals displayed - but display methods and other fields still show decimals.

    I hope that with a little bit of effort you can tweak this solution to fulfill your needs.

    Thanks,

    Maciej

  • Alok Joshi Profile Picture
    540 on at

    Hi Maciej,

    Thanks for your post.

    That sounds like a good idea.

    Yes agree that for the display methods some work will have to be done.

    Alok.

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 AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans