Forum Discussion
- OSAdminValued ContributorOriginally posted by Eric Osmanski
Create dynamic accounts which pull the rates. If you have an FX calc you should have the syntax. The source currency you can base on the POV C#. I can post something here when I get by a computer.
Dim fxRateTypeName As String = api.FxRates.GetFxRateTypeForAssetLiability().Name 'Rate type for Balance Sheet accounts
Dim timeId As Integer = api.Pov.Time.MemberId 'Time period being processed
Dim sourceCurrencyId As Integer = api.Pov.Cons.MemberId 'POV currency
Dim destCurrencyId As Integer = api.Members.GetMemberId(Dimtype.Consolidation.Id, ""USD"")'USD
Dim closingRate As Decimal = api.FxRates.GetCalculatedFxRate(fxRateTypeName, timeId, sourceCurrencyId, destCurrencyId)
Return closingRate
Create a Dynamic Account, put that code in, and then whatever C# in the POV is it will return the associated Closing Rate to USD. I hardcoded the destination as USD in this example (because that's all I was required to show) but it could be made more dynamic for the destination currency if you have that need.