Forum Discussion

denisefockler's avatar
denisefockler
New Contributor III
2 months ago
Solved

Public Overloads Function GetCalculatedFxRate... is obsolete

Is someone able to assist me with an alternative method for GetCalculatedFxRate on line 14 of the code below?  We just upgraded to 8.5.1 and this is no longer being supported.  In 8.2.3 it was still working.  This is a parser business rule that is being applied to a data source and calculation happening when data is being imported.

				'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
				'Purpose: Get Translation rate for To/From currencies on current record. 
				'		  Store translation rate in global variable to use with subsequent records for performance improvements.
				'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~	
								
				Dim time As String = api.CurrentDataClusterKey.TimeName 'Get current time.
				Dim currencyRate As Decimal = globals.GetDecimalValue(fromCurrency & "-" & toCurrency & "-" & time) 'Check Global variable for current translation rate.
				If Not currencyRate = Nothing Then 'If Globals is populated, return rate from global variable.
					Return currencyRate
				Else 'Else, get translation rate from Database and store in Global variable.
					Dim rateType As FxRateType = BRApi.Finance.Scenario.GetFxRateTypeForRevenueExpense(si, api.CurrentDataClusterKey.ScenarioID) 'Get Revenue rate type for current scenario
					Dim defaultCurrencyId As Integer = BRApi.Finance.Cubes.GetDefaultCurrencyId(si, 0) 'Get Cube's default currency ID
					Dim objActFxRate As New FxRatePkUsingNames(rateType.ToString, time, fromCurrency, toCurrency) 'Get rate information for current translation.
					Dim rate As Decimal = BRApi.Finance.Data.GetCalculatedFxRate(si, defaultCurrencyID, objActFxRate) 'Get translation Amount
					Globals.SetDecimalValue(fromCurrency & "-" & toCurrency & "-" & time, rate) 'Store current translation amount in global variable.
					Return rate 'Return Translation Rate.
				End If

Thank you, 

Denise

  • Not just obsolete but also slightly changed; we observed different output in certain situations which is the issue mentioned below. GetFXRate is supposed to replace GetCalculatedFXRate and GetStoredFXRate.

    I would just forget the workaround mentioned and use GetFXRate since it seems to be the way forward.

     

5 Replies

  • DanielWillis's avatar
    DanielWillis
    Valued Contributor

    Not just obsolete but also slightly changed; we observed different output in certain situations which is the issue mentioned below. GetFXRate is supposed to replace GetCalculatedFXRate and GetStoredFXRate.

    I would just forget the workaround mentioned and use GetFXRate since it seems to be the way forward.

     

    • denisefockler's avatar
      denisefockler
      New Contributor III

      Thank you.  I did get a response back from OneStream on the case I opened.  In addition to what you have mentioned, they provided me the attached document with more extensive examples of how to correct.  I have it working now.  I am still confused on why this was not mentioned in the 8.5  release notes.  We review release notes a few months prior to the upgrade.  In your experience is there another resource available from OneStream that would list defects for a given release that I should be reviewing in addition to release notes?  I compile all BRs and Formulas before and after the upgrade but had no way of catching this issue because the compile just showed a warning.

       

       

      • DanielWillis's avatar
        DanielWillis
        Valued Contributor

        I have the same pdf from support and I don't understand why it isn't provided either. I didn't share it because OneStream hadn't made the doc public for whatever reason and I didn't want to tread on any toes. I echoed your thoughts on my support ticket at the time. There was a decent amount of time spent investigating / responding to this.

  • NN's avatar
    NN
    Contributor

    Hi,
    I had the same issue in v8.5.0 and a lot of time spent investigate the issue.
    We got the same document from support and it's sad that it wasn't attached /addressed in v8.5.1.  With the changes described in the pdf we solved the issue.

  • smarshall2's avatar
    smarshall2
    New Contributor II

    Hi Folks, 

    I think they updated the 8.5.1 Release Notes to reflect that it was Deprecated. If I read the 9.0 Release Notes properly, it looks like it is corrected.  If my read of 9.0 is incorrect, let me know.  We are working on an upgrade now, so hoping this is correct. 

    Thanks!