Currency conversion

kolaboy
Member Posts: 446
Hi Experts,
I have a field call grant total in report which is defined in C/AL globals as decimal and is use to calculate Grand total for totals. How do you convert this field values which is in foreign currency to a local currency?
Thanks.
I have a field call grant total in report which is defined in C/AL globals as decimal and is use to calculate Grand total for totals. How do you convert this field values which is in foreign currency to a local currency?
Thanks.
0
Comments
-
What exchange rate do you want to use as at today?
Assuming your report has a group total by "Currency Code"
Hint:
Look at the code on the Sales Line table search for FCYtoLCY
DavidAnalyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com0 -
I am using 30.00 for a test.
The variable is not a standard field in the table. I defined it to take the results of the calculated total for the totals of certain amounts. this value is in foreign currency USD and i want to convert the equivalent to LCY.
I have not seen FCYtoLCY in the sales line table.
can you please tell me what i should do to get the equivalence in LCY Please!!!
Thanks.0 -
The "Currency Exchange Rate" tables has currency functions for
LCY to FCY
FCY to LCY
FCY to FCY
Currency = Record = Currency
CurrExchRate = Record = Currency Exchange Rate
AmountLCY = Decimal
AmountFCY = Decimal
You also need a "Currency Code"
This function will return the currency factor
CurrExchRate.ExchangeRate(WORKDATE,"Currency Code")//Sets the Defaults Currency.InitRoundingPrecision; IF "Currency Code" <> '' THEN AmountLCY := ROUND( CurrExchRate.ExchangeAmtFCYToLCY( WORKDATE,"Currency Code", AmountFCY,CurrExchRate.ExchangeRate(WORKDATE,"Currency Code")), Currency."Amount Rounding Precision") ELSE AmountLCY := ROUND(AmountFCY,Currency."Amount Rounding Precision");
DavidAnalyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com1 -
Thank you very much David, It has worked.
=D>0 -
Thanks David.0
-
if you are using a document in the header you will find a field called "currency factor". That's the rate applied for the day the document was created.
Just do a calcfields() to amounts in the header and then *"currency factor"
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions