Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Overflow under conversion error in Navision

Posted on by 2,576

Hi,

I have an action button in purchase order page which on clicking opens up the purchase order report. But while running the report, I get the following error:

Overflow under conversion of Microsoft.Dynamics.Nav.Runtime.Decimal18 value 1.500 to System.Int32

While running the debugger, the error stops at the 'Check report 1401' because I have coded for converting amount to words in my purchase order report.

How can I solve this error?

*This post is locked for comments

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Overflow under conversion error in Navision

    Hi

    You can use like

    CheckReport.InitTextVariable;

    CheckReport.FormatNoText(AmtinWords,"Purchase Header"."Amount to Vendor","Purchase Header"."Currency Code");

    Define variable as follows

    AmtinWords Text 200  (This need to define as Array)

    CheckReport Report 1401

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Overflow under conversion error in Navision

    Where exactly the debugger stops when it throws an error, the other possibility is it may not be because of this cutomization it could be something else. Do you have any other customizations ?

  • Tina Menezes Profile Picture
    Tina Menezes 2,576 on at
    RE: Overflow under conversion error in Navision

    I do not have this report.

    This is my Navision version 9.00.45778

    Actually my report runs for other purchase order records. But only for one record I get this error.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Overflow under conversion error in Navision

    It is the report 10400.  Which country NAV version are you running ?

  • Tina Menezes Profile Picture
    Tina Menezes 2,576 on at
    RE: Overflow under conversion error in Navision

    Hello,

    There is no report in my system named as 'Check Translation Management'.

    The Check report which I used is a system report with ID 1401.

    Yes Amount to vendor is a decimal field

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Overflow under conversion error in Navision

    Hello,

    You could use the following code to get the value

    ChkTransMgt.FormatNoText(NoText,"Purchase Header"."Amount to Vendor",1033,"Purchase Header"."Currency Code") ;

    AmontInWords := NoText[1];

    Where ChkTransMgt is object of Report Check Translation Management

    Try the above code.

    Is Amount to Vendor is a decimal field ?

  • Tina Menezes Profile Picture
    Tina Menezes 2,576 on at
    RE: Overflow under conversion error in Navision

    This is my code:

    RepCheck.InitTextVariable;

    RepCheck.FormatNoText(NoText,"Purchase Header"."Amount to Vendor","Purchase Header"."Currency Code");

    AmountInWords:=NoText[1];

    Where I have defined,

    RepCheck as the 'Check' report,  NoText is a text variable of dimension 2 and AmountInWords is a text variable too defined under C/AL Globals.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Overflow under conversion error in Navision

    Send the screeshot of the code you have added to convert the amount into text.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans