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

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

ERROR An invalid field or attribute has been specified for the 'Format' property.

(0) ShareShare
ReportReport
Posted on by 295

I got an error when i format the number for the report

An invalid field or attribute has been specified for the 'Format' property.

pastedimage1681966081942v1.png

   gTotalRequestAmount := format(1000002, 15, '<Sign><Decimals>');
---------------
 gTotalRequestAmount: Text;
Could you please share your experience on this error ?
I have the same question (0)
  • Suggested answer
    ShanAbeywicrema Profile Picture
    948 on at
    RE: ERROR An invalid field or attribute has been specified for the 'Format' property.

    You can use following syntax, it's simple. But your code also working for me. what is the issue you got?

     gTotalRequestAmount := FORMAT(555777.85,15,3);

    pastedimage1681973282843v1.png

    I got same output in BC

    pastedimage1681973646136v1.png

     gTotalRequestAmount := FORMAT("Purchase Header"."Amount Including VAT",15,3);


  • Hoang Ng Profile Picture
    295 on at
    RE: ERROR An invalid field or attribute has been specified for the 'Format' property.

    Thanks Shan, Narang

    I want to format Amount with thousand separator. I tried to change parameter value in FORMAT but not successful

    gTotalRequestAmount := FORMAT("Purchase Header"."Amount Including VAT", 0, '<Sign><Integer Thousand><Decimals>')

    Thanks.

  • Suggested answer
    ShanAbeywicrema Profile Picture
    948 on at
    RE: ERROR An invalid field or attribute has been specified for the 'Format' property.

    What do you need to achieve. if you use this format string you can specify decimal value. such as 1000002.25

    it should be gTotalRequestAmount := FORMAT(1000002.5, 15, '<Sign><Decimals>');

    if you don't have decimal use something like this

    gTotalRequestAmount := FORMAT(1000002, 15, '<Sign><Integer>');

    get idea from following resources

    learn.microsoft.com/.../format-function--code--text-

    learn.microsoft.com/.../format-property

  • Suggested answer
    NAV_with_Narang Profile Picture
    2,250 Moderator on at
    RE: ERROR An invalid field or attribute has been specified for the 'Format' property.

    If your aim is to convert integer/decimal into a text, just use:

    Text := FORMAT(Integer);

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 3,878

#2
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 3,405

#3
Sumit Singh Profile Picture

Sumit Singh 2,865

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans