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 :
Small and medium business | Business Central, N...
Answered

AL: Right alignment of a text field

(0) ShareShare
ReportReport
Posted on by 3,255

Hi Guys,

I have added a consternated field (Currency + Price) on to item list page as a text field and this is left aligned and shows like below:

Currency and Price

$10.5

Is there a way to programmatically change the alignment to below:

Currency and Price

                      $10.5

Thanks

I have the same question (0)
  • Suggested answer
    Jack Davies Profile Picture
    120 on at

    User the AutoFormat properties on the page...

    AutoFormatExpression = '1,USD';

    AutoFormatType = 10;

    left-align.png

    The result is right aligned

  • Samantha73 Profile Picture
    3,255 on at

    This can work if we are looking at one currency but the price is defined in different currencies hence I'm concatenating two fields and autoformat needs a non text field. May be pass currency as a variable or something like that to Autoformat formula

  • Verified answer
    Jack Davies Profile Picture
    120 on at

    You can set the AutoFormatExpression to a function call as well ... AutoFormatExpression = GetFormatString();

    and then add code to return the relevant currency string

    procedure GetFormatString() : Text

    Begin

    CASE "Currency Code your Working in" OF

    'USD' : Exit('1,USD');

    'GBP' : Exit('1,GBP');

    //. . . . .

    END;

    end;

    you can also use AutoFormatType 11 and come up with you own formatting in the AutoFormatExpression (i.e. 'Golden Galleons <Precision,5:5><Standard Format,0>'

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,066

#2
YUN ZHU Profile Picture

YUN ZHU 658 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 595

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans