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)

x++ : field format in form to show 99999.99-99

(0) ShareShare
ReportReport
Posted on by

Hi experts,

I'm new to AX 2012 R3 CU9, i'm also new to programming. Please guide me,I have integer field in my form. I need this field to have format like this : 99999.99-99.#####

Where 9 is number 0-9, and ####### is nothing it's just for show.
Users gonna entered their number in 99999.99-99. How can i achieve this? Is there any code example for this? And where i put those code (In form's method, or in field''s method)? Thank you.

*This post is locked for comments

I have the same question (0)
  • Dauvis Profile Picture
    170 on at

    You will have to use an edit method for this.  In the method, you will add the logic to convert the user entry to the integer and the integer to its formatted value.  Here is a link to get you started: www.axaptapedia.com/Edit_method

  • Rudi Hansen Profile Picture
    4,075 on at

    Don't you mean a string?

    Integers holds numbers with no fractional part, so an integer can be 1 but not 1.9

  • Community Member Profile Picture
    on at

    Oh you're right it's string.

  • Rudi Hansen Profile Picture
    4,075 on at

    Ok that should be possible then, but then I need to know more about what the purpose is, from what you wrote in your first post I don't know what you are trying to achieve.

    Are you trying to get a number formatted in a certain way like in the NumberSequenceTable form?

  • Community Member Profile Picture
    on at

    Hey Rudi, so my purpose is the field going to looks something like this :

    7433.1.PNG

    User will input numbers with format like i mentioned above on my post.

    Actually i already got the code but only to show it in info :

    info(strFmt("%1. %2. %3. %4 -%5 .%6",subStr(number, 0,2),substr(number,3,3),subStr(number,6,3),subStr(number,9,1),subStr(number,10,3),subStr(number,13,3)));

    But i have no idea how to affect the field or use it in edit method so it will have looks like 7433.1.PNG

    About edit method, every source i have found gave an example of changing colors, or NoYes checkbox. I can't implement that with my current scenario. Thanks

  • jasman Profile Picture
    1,413 on at

    I guess what you are showing is the Segmented Entry Control in AX, which is only used for ledgerdimension fields.

    I doubt that you can make a field with the behaviour that you want using standard AX controls.

    But maybe you can make a managed host user control solution.

  • Community Member Profile Picture
    on at

    I thought so too, it's segmented entry. But i'm still hoping that there's another simple way. What about like what Dauvis had mentioned before to use edit method? But i still can't figure that out how.

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